Part Number Hot Search : 
CIL476 CNY75CX AAT11 S29DL640 110CA CP15308 78L24A SDS511
Product Description
Full Text Search
 

To Download MC68HC08KH12 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  MC68HC08KH12/h rev. 1.0 68hc08kh12 68hc708kh12 advance information june 7, 1999 semiconductor products sector
advance information advance information mc68hc(7)08kh12 ? rev. 1.0 ii motorola motorola reserves the right to make changes without further notice to any products herein to improve reliability, function or design. motorola does not assume any liability arising out of the application or use of any product or circuit described herein; neither does it convey any license under its patent rights nor the rights of others. motorola products are not designed, intended, or authorized for use as components in systems intended for surgical implant into the body, or other applications intended to support or sustain life, or for any other application in which the failure of the motorola product could create a situation where personal injury or death may occur. should buyer purchase or use motorola products for any such unintended or unauthorized application, buyer shall indemnify and hold motorola and its officers, employees, subsidiaries, affiliates, and distributors harmless against all claims, costs, damages, and expenses, and reasonable attorney fees arising out of, directly or indirectly, any claim of personal injury or death associated with such unintended or unauthorized use, even if such claim alleges that motorola was negligent regarding the design or manufacture of the part.
mc68hc(7)08kh12 ? rev. 1.0 advance information motorola list of sections 3 advance information ?mc68hc(7)08kh12 list of sections section 1. general description .......................................23 section 2. memory map ...................................................33 section 3. random-access memory (ram) ...................45 section 4. read-only memory (rom) .............................47 section 5. configuration register (config) .................49 section 6. central processor unit (cpu) .......................51 section 7. system integration module (sim) .................61 section 8. clock generator module (cgm) ....................87 section 9. universal serial bus module (usb) ............113 section 10. monitor rom (mon) ...................................149 section 11. timer interface module (tim) ....................161 section 12. i/o ports ......................................................183 section 13. computer operating properly (cop) .......207 section 14. external interrupt (irq) .............................213 section 15. keyboard interrupt module (kbi) ..............219 section 16. break module (break) .............................241 section 17. preliminary electrical specifications .......247 section 18. mechanical specifications ........................259
list of sections advance information mc68hc(7)08kh12 ? rev. 1.0 4 list of sections motorola
mc68hc(7)08kh12 ? rev. 1.0 advance information motorola table of contents 5 advance information ?mc68hc(7)08kh12 table of contents general description 1.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 1.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 1.3 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 1.4 mcu block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 1.5 pin assignments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 1.5.1 quad flat pack (qfp) package . . . . . . . . . . . . . . . . . . . . . 28 1.5.2 power supply pins (v dda , v ssa , v dd1 , v ss1 , v dd2 , and v ss2 ) . . . . . . . . . . 29 1.5.3 oscillator pins (osc1 and osc2) . . . . . . . . . . . . . . . . . . . 30 1.5.4 external reset pin (rst ) . . . . . . . . . . . . . . . . . . . . . . . . . . 30 1.5.5 external interrupt pin (irq1 /v pp ) . . . . . . . . . . . . . . . . . . . . 30 1.5.6 usb data pins (dplus0?plus4 and dminus0?minus4). . . . . . . 30 1.5.7 voltage regulator out (regout) . . . . . . . . . . . . . . . . . . . 30 1.5.8 port a input/output (i/o) pins (pta7?ta0) . . . . . . . . . . . 31 1.5.9 port b i/o pins (ptb7?tb0) . . . . . . . . . . . . . . . . . . . . . . . 31 1.5.10 port c i/o pins (ptc4?tc0). . . . . . . . . . . . . . . . . . . . . . . 31 1.5.11 port d i/o pins (ptd7/kbd7?td0/kbd0) . . . . . . . . . . . . 31 1.5.12 port e i/o pins (pte4, pte3/kbe3, pte2/kbe2/tch1, pte1/kbe1/tch0, pte0/kbe0/tclk) . . . . . . . . . . . . . 31 1.5.13 port f i/o pins (ptf7/kbf7?tf0/kbf0) . . . . . . . . . . . . . 32 section 2. memory map 2.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 2.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
table of contents advance information mc68hc(7)08kh12 ? rev. 1.0 6 table of contents motorola 2.3 i/o section . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 2.4 monitor rom . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 section 3. random-access memory (ram) 3.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 3.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 3.3 functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 section 4. read-only memory (rom) 4.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 4.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 4.3 functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 section 5. configuration register (config) 5.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 5.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 5.3 functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 section 6. central processor unit (cpu) 6.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 6.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 6.3 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 6.4 cpu registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 6.4.1 accumulator (a). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 6.4.2 index register (h:x) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 6.4.3 stack pointer (sp). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 6.4.4 program counter (pc) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 6.4.5 condition code register (ccr) . . . . . . . . . . . . . . . . . . . . . 57 6.5 arithmetic/logic unit (alu) . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
table of contents mc68hc(7)08kh12 ? rev. 1.0 advance information motorola table of contents 7 section 7. system integration module (sim) 7.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 7.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 7.3 sim bus clock control and generation . . . . . . . . . . . . . . . . . . 65 7.3.1 bus timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 7.3.2 clock start-up from por . . . . . . . . . . . . . . . . . . . . . . . . . . 66 7.3.3 clocks in stop mode and wait mode . . . . . . . . . . . . . . . . . 66 7.4 reset and system initialization. . . . . . . . . . . . . . . . . . . . . . . . . 66 7.4.1 external pin reset. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 7.4.2 active resets from internal sources . . . . . . . . . . . . . . . . . . 67 7.4.2.1 power-on reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 7.4.2.2 computer operating properly (cop) reset . . . . . . . . . . 69 7.4.2.3 illegal opcode reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 7.4.2.4 illegal address reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 7.4.2.5 universal serial bus reset . . . . . . . . . . . . . . . . . . . . . . . 70 7.5 sim counter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 7.5.1 sim counter during power-on reset . . . . . . . . . . . . . . . . . 71 7.5.2 sim counter during stop mode recovery . . . . . . . . . . . . . 71 7.5.3 sim counter and reset states . . . . . . . . . . . . . . . . . . . . . . 71 7.6 exception control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 7.6.1 interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 7.6.1.1 hardware interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 7.6.1.2 swi instruction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76 7.6.2 interrupt status registers . . . . . . . . . . . . . . . . . . . . . . . . . . 76 7.6.2.1 interrupt status register 1 . . . . . . . . . . . . . . . . . . . . . . . . 77 7.6.2.2 interrupt status register 2 . . . . . . . . . . . . . . . . . . . . . . . . 78 7.6.2.3 interrupt status register 3 . . . . . . . . . . . . . . . . . . . . . . . . 78 7.6.3 reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 7.6.4 break interrupts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 7.6.5 status flag protection in break mode. . . . . . . . . . . . . . . . . 79 7.7 low-power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 7.7.1 wait mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 7.7.2 stop mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 7.8 sim registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 7.8.1 break status register (bsr). . . . . . . . . . . . . . . . . . . . . . . . 83
table of contents advance information mc68hc(7)08kh12 ? rev. 1.0 8 table of contents motorola 7.8.2 reset status register (rsr) . . . . . . . . . . . . . . . . . . . . . . . 84 7.8.3 break flag control register (bfcr). . . . . . . . . . . . . . . . . . 85 section 8. clock generator module (cgm) 8.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 8.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 8.3 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 8.4 functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 8.4.1 crystal oscillator circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . 91 8.4.2 phase-locked loop circuit (pll) . . . . . . . . . . . . . . . . . . . . 91 8.4.3 pll circuits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91 8.4.4 acquisition and tracking modes . . . . . . . . . . . . . . . . . . . . . 93 8.4.5 manual and automatic pll bandwidth modes . . . . . . . . . . 93 8.4.6 programming the pll . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 8.4.7 special programming exceptions . . . . . . . . . . . . . . . . . . . . 95 8.4.8 base clock selector circuit. . . . . . . . . . . . . . . . . . . . . . . . . 96 8.4.9 cgm external connections. . . . . . . . . . . . . . . . . . . . . . . . . 96 8.5 i/o signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98 8.5.1 crystal amplifier input pin (osc1) . . . . . . . . . . . . . . . . . . . 98 8.5.2 crystal amplifier output pin (osc2) . . . . . . . . . . . . . . . . . . 98 8.5.3 external filter capacitor pin (cgmxfc). . . . . . . . . . . . . . . 98 8.5.4 pll analog power pin (v dda ) . . . . . . . . . . . . . . . . . . . . . . 98 8.5.5 pll analog ground pin (v ssa ) . . . . . . . . . . . . . . . . . . . . . . 98 8.5.6 buffered crystal clock output (cgmvout) . . . . . . . . . . . . 99 8.5.7 cgmvsel. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99 8.5.8 oscillator enable signal (simoscen) . . . . . . . . . . . . . . . . 99 8.5.9 crystal output frequency signal (cgmxclk) . . . . . . . . . . 99 8.5.10 cgm base clock output (cgmout) . . . . . . . . . . . . . . . . . 99 8.5.11 cgm cpu interrupt (cgmint) . . . . . . . . . . . . . . . . . . . . . . 99 8.6 cgm registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100 8.6.1 pll control register (pctl) . . . . . . . . . . . . . . . . . . . . . . 102 8.6.2 pll bandwidth control register (pbwc) . . . . . . . . . . . . . 104 8.6.3 pll multiplier select registers (pmsh:pmsl). . . . . . . . . 105 8.6.4 pll reference divider select register (prds) . . . . . . . . 106
table of contents mc68hc(7)08kh12 ? rev. 1.0 advance information motorola table of contents 9 8.7 interrupts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107 8.8 special modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107 8.8.1 wait mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107 8.8.2 cgm during break interrupts . . . . . . . . . . . . . . . . . . . . . . 108 8.9 acquisition/lock time specifications . . . . . . . . . . . . . . . . . . . 108 8.9.1 acquisition/lock time definitions . . . . . . . . . . . . . . . . . . . 108 8.9.2 parametric influences on reaction time . . . . . . . . . . . . . 109 8.9.3 choosing a filter capacitor. . . . . . . . . . . . . . . . . . . . . . . . 111 8.9.4 reaction time calculation . . . . . . . . . . . . . . . . . . . . . . . . 111 section 9. universal serial bus module (usb) 9.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113 9.2 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114 9.3 overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115 9.4 i/o register description of the hub function . . . . . . . . . . . . . 116 9.4.1 usb hub root port control register (hrpcr) . . . . . . . . 120 9.4.2 usb hub downstream port control register (hdp1cr-hdp4cr) . . . . . . . . . . . . . . . . . . . . . . . . . . 121 9.4.3 usb sie timing interrupt register (sietir). . . . . . . . . . . 123 9.4.4 usb sie timing status register (sietsr) . . . . . . . . . . . 125 9.4.5 usb hub address register (haddr) . . . . . . . . . . . . . . . 127 9.4.6 usb hub interrupt register 0 (hir0) . . . . . . . . . . . . . . . . 128 9.4.7 usb hub control register 0 (hcr0) . . . . . . . . . . . . . . . . 129 9.4.8 usb hub endpoint1 control & data register (hcdr) . . 131 9.4.9 usb hub status register (hsr) . . . . . . . . . . . . . . . . . . . 132 9.4.10 usb hub endpoint 0 data registers 0-7 (he0d0-he0d7). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134 9.5 i/o register description of the embedded device function . 134 9.5.1 usb embedded device address register (daddr) . . . . 138 9.5.2 usb embedded device interrupt register 0 (dir0) . . . . . 138 9.5.3 usb embedded device interrupt register 1 (dir1) . . . . . 140 9.5.4 usb embedded device control register 0 (dcr0) . . . . . 141 9.5.5 usb embedded device control register 1 (dcr1) . . . . . 143 9.5.6 usb embedded device status register (dsr) . . . . . . . . 144
table of contents advance information mc68hc(7)08kh12 ? rev. 1.0 10 table of contents motorola 9.5.7 usb embedded device control register 2 (dcr2) . . . . . 146 9.5.8 usb embedded device endpoint 0 data registers (de0d0-de0d7). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147 9.5.9 usb embedded device endpoint 1/2 data registers (de1d0-de1d7). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148 section 10. monitor rom (mon) 10.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149 10.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149 10.3 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150 10.4 functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150 10.4.1 entering monitor mode . . . . . . . . . . . . . . . . . . . . . . . . . . . 152 10.4.2 data format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154 10.4.3 echoing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154 10.4.4 break signal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155 10.4.5 commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155 10.4.6 baud rate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159 section 11. timer interface module (tim) 11.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161 11.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162 11.3 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162 11.4 functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163 11.4.1 tim counter prescaler . . . . . . . . . . . . . . . . . . . . . . . . . . . 165 11.4.2 input capture. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165 11.4.3 output compare . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165 11.4.3.1 unbuffered output compare . . . . . . . . . . . . . . . . . . . . . 166 11.4.3.2 buffered output compare . . . . . . . . . . . . . . . . . . . . . . . 166 11.4.4 pulse width modulation (pwm) . . . . . . . . . . . . . . . . . . . . 167 11.4.4.1 unbuffered pwm signal generation . . . . . . . . . . . . . . . 168 11.4.4.2 buffered pwm signal generation . . . . . . . . . . . . . . . . . 169 11.4.4.3 pwm initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170 11.5 interrupts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
table of contents mc68hc(7)08kh12 ? rev. 1.0 advance information motorola table of contents 11 11.6 wait mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171 11.7 tim during break interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . 172 11.8 i/o signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172 11.8.1 tim clock pin (pte0/tclk) . . . . . . . . . . . . . . . . . . . . . . . 172 11.8.2 tim channel i/o pins (pte1/tch0:pte2/tch1). . . . . . . 173 11.9 i/o registers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173 11.9.1 tim status and control register (tsc) . . . . . . . . . . . . . . 173 11.9.2 tim counter registers (tcnth:tcntl) . . . . . . . . . . . . . 175 11.9.3 tim counter modulo registers (tmodh:tmodl) . . . . . . 176 11.9.4 tim channel status and control registers (tsc0:tsc1) 177 11.9.5 tim channel registers (tch0h/l?ch1h/l) . . . . . . . . . 181 section 12. i/o ports 12.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183 12.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184 12.3 port a . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186 12.3.1 port a data register (pta) . . . . . . . . . . . . . . . . . . . . . . . . 186 12.3.2 data direction register a (ddra) . . . . . . . . . . . . . . . . . . 186 12.4 port b . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188 12.4.1 port b data register (ptb) . . . . . . . . . . . . . . . . . . . . . . . . 188 12.4.2 data direction register b (ddrb) . . . . . . . . . . . . . . . . . . 189 12.5 port c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190 12.5.1 port c data register (ptc). . . . . . . . . . . . . . . . . . . . . . . . 190 12.5.2 data direction register c (ddrc) . . . . . . . . . . . . . . . . . . 191 12.6 port d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192 12.6.1 port d data register (ptd). . . . . . . . . . . . . . . . . . . . . . . . 193 12.6.2 data direction register d (ddrd) . . . . . . . . . . . . . . . . . . 193 12.7 port e . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195 12.7.1 port e data register (pte) . . . . . . . . . . . . . . . . . . . . . . . . 195 12.7.2 data direction register e (ddre) . . . . . . . . . . . . . . . . . . 196 12.7.3 port-e optical interface enable register . . . . . . . . . . . . . 198 12.8 port f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202
table of contents advance information mc68hc(7)08kh12 ? rev. 1.0 12 table of contents motorola 12.8.1 port f data register (ptf) . . . . . . . . . . . . . . . . . . . . . . . . 202 12.8.2 data direction register f (ddrf). . . . . . . . . . . . . . . . . . . 203 12.9 port options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204 12.9.1 port option control register (poc) . . . . . . . . . . . . . . . . . 204 section 13. computer operating properly (cop) 13.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207 13.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207 13.3 functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208 13.4 i/o signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209 13.4.1 cgmxclk. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209 13.4.2 copctl write . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209 13.4.3 power-on reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210 13.4.4 internal reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210 13.4.5 reset vector fetch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210 13.4.6 copd (cop disable) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210 13.4.7 coprs (cop rate select). . . . . . . . . . . . . . . . . . . . . . . . 210 13.5 cop control register (copctl) . . . . . . . . . . . . . . . . . . . . . . 211 13.6 interrupts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211 13.7 monitor mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211 13.8 low-power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212 13.8.1 wait mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212 13.8.2 stop mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212 13.9 cop module during break mode . . . . . . . . . . . . . . . . . . . . . . 212 section 14. external interrupt (irq) 14.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213 14.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213 14.3 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213 14.4 functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214
table of contents mc68hc(7)08kh12 ? rev. 1.0 advance information motorola table of contents 13 14.4.1 irq1 /v pp pin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215 14.5 irq module during break interrupts . . . . . . . . . . . . . . . . . . . 217 14.6 irq status and control register (iscr) . . . . . . . . . . . . . . . . 217 section 15. keyboard interrupt module (kbi) 15.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219 15.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220 15.3 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220 15.4 port-d keyboard interrupt block diagram . . . . . . . . . . . . . . . 222 15.4.1 port-d keyboard interrupt functional description. . . . . . . 223 15.4.2 port-d keyboard initialization . . . . . . . . . . . . . . . . . . . . . . 224 15.4.3 port-d keyboard interrupt registers . . . . . . . . . . . . . . . . . 225 15.4.3.1 port-d keyboard status and control register: . . . . . . . 225 15.4.3.2 port-d keyboard interrupt enable register . . . . . . . . . . 226 15.5 port-e keyboard interrupt block diagram . . . . . . . . . . . . . . . 228 15.5.1 port-e keyboard interrupt functional description. . . . . . . 229 15.5.2 port-e keyboard initialization . . . . . . . . . . . . . . . . . . . . . . 230 15.5.3 port-e keyboard interrupt registers . . . . . . . . . . . . . . . . . 231 15.5.3.1 port-e keyboard status and control register . . . . . . . . 231 15.5.3.2 port-e keyboard interrupt enable register . . . . . . . . . . 232 15.6 port-f keyboard interrupt block diagram. . . . . . . . . . . . . . . . 234 15.6.1 port-f keyboard interrupt functional description . . . . . . . 235 15.6.2 port-f keyboard initialization . . . . . . . . . . . . . . . . . . . . . . 236 15.6.3 port-f keyboard interrupt registers . . . . . . . . . . . . . . . . . 237 15.6.3.1 port-f keyboard status and control register . . . . . . . . 237 15.6.3.2 port-f keyboard interrupt enable register . . . . . . . . . . 238 15.6.3.3 port-f pull-up enable register . . . . . . . . . . . . . . . . . . . 239 15.7 wait mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239 15.8 stop mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239 15.9 keyboard module during break interrupts . . . . . . . . . . . . . . . 239
table of contents advance information mc68hc(7)08kh12 ? rev. 1.0 14 table of contents motorola section 16. break module (break) 16.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241 16.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241 16.3 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242 16.4 functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242 16.4.1 flag protection during break interrupts . . . . . . . . . . . . . . 244 16.4.2 cpu during break interrupts. . . . . . . . . . . . . . . . . . . . . . . 244 16.4.3 tim during break interrupts . . . . . . . . . . . . . . . . . . . . . . . 244 16.4.4 cop during break interrupts . . . . . . . . . . . . . . . . . . . . . . 244 16.5 break module registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244 16.5.1 break status and control register (brkscr) . . . . . . . . . 245 16.5.2 break address registers (brkh and brkl) . . . . . . . . . . 245 16.6 low-power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246 16.6.1 wait mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246 16.6.2 stop mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246 section 17. preliminary electrical specifications 17.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247 17.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247 17.3 absolute maximum ratings . . . . . . . . . . . . . . . . . . . . . . . . . . 248 17.4 functional operating range. . . . . . . . . . . . . . . . . . . . . . . . . . 249 17.5 thermal characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249 17.6 dc electrical characteristics . . . . . . . . . . . . . . . . . . . . . . . . . 250 17.7 control timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251 17.8 oscillator characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251 17.9 usb dc electrical characteristics . . . . . . . . . . . . . . . . . . . . . 252 17.10 usb low speed source electrical characteristics. . . . . . . . . 253 17.11 usb high speed source electrical characteristics . . . . . . . . 254
table of contents mc68hc(7)08kh12 ? rev. 1.0 advance information motorola table of contents 15 17.12 hub repeater electrical characteristics . . . . . . . . . . . . . . . . 255 17.13 usb signaling levels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256 17.14 timer interface module characteristics . . . . . . . . . . . . . . . . . 256 17.15 clock generation module characteristics . . . . . . . . . . . . . . . 257 17.15.1 cgm component specifications . . . . . . . . . . . . . . . . . . . . 257 17.15.2 cgm electrical specifications . . . . . . . . . . . . . . . . . . . . . . 257 17.15.3 acquisition/lock time specifications . . . . . . . . . . . . . . . . 258 section 18. mechanical specifications 18.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259 18.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259 18.3 plastic quad flat pack (qfp). . . . . . . . . . . . . . . . . . . . . . . . . 260
table of contents advance information mc68hc(7)08kh12 ? rev. 1.0 16 table of contents motorola
mc68hc(7)08kh12 ? rev. 1.0 advance information motorola list of figures 17 advance information ?mc68hc(7)08kh12 list of figures figure title page 1-1 mcu block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 1-2 64-pin qfp assignments (top view) . . . . . . . . . . . . . . . . . . . . 28 1-3 power supply bypassing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 2-1 memory map. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 2-2 control, status, and data registers . . . . . . . . . . . . . . . . . . . . . 36 5-1 configuration register (config). . . . . . . . . . . . . . . . . . . . . . . 50 6-1 cpu registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 6-2 accumulator (a) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 6-3 index register (h:x) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 6-4 stack pointer (sp) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 6-5 program counter (pc) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 6-6 condition code register (ccr) . . . . . . . . . . . . . . . . . . . . . . . . 57 7-1 sim block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 7-2 sim i/o register summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 7-3 sim clock signals. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 7-4 external reset timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 7-5 internal reset timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 7-6 sources of internal reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 7-7 por recovery . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 7-8 interrupt processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73 7-9 interrupt entry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 7-10 interrupt recovery . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 7-11 interrupt recognition example . . . . . . . . . . . . . . . . . . . . . . . . . 75 7-12 interrupt status register 1 (int1). . . . . . . . . . . . . . . . . . . . . . . 77 7-13 interrupt status register 2 (int2). . . . . . . . . . . . . . . . . . . . . . . 78 7-14 interrupt status register 2 (int2). . . . . . . . . . . . . . . . . . . . . . . 78
list of figures advance information mc68hc(7)08kh12 ? rev. 1.0 18 list of figures motorola figure title page 7-15 wait mode entry timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 7-16 wait recovery from interrupt or break . . . . . . . . . . . . . . . . . . . 81 7-17 wait recovery from internal reset. . . . . . . . . . . . . . . . . . . . . . 81 7-18 stop mode entry timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 7-19 stop mode recovery from interrupt or break . . . . . . . . . . . . . . 82 7-20 break status register (bsr) . . . . . . . . . . . . . . . . . . . . . . . . . . 83 7-21 reset status register (rsr) . . . . . . . . . . . . . . . . . . . . . . . . . . 84 7-22 break flag control register (bfcr) . . . . . . . . . . . . . . . . . . . . 85 8-1 cgm block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90 8-2 cgm external connections . . . . . . . . . . . . . . . . . . . . . . . . . . . 97 8-3 pll control register (pctl) . . . . . . . . . . . . . . . . . . . . . . . . . 102 8-4 pll bandwidth control register (pbwc) . . . . . . . . . . . . . . . 104 8-5 pll multiplier select registers (pmsh:pmsl) . . . . . . . . . . . 105 8-6 pll reference divider select register (prds). . . . . . . . . . . 106 9-1 usb block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116 9-2 usb hub root port control register (hrpcr) . . . . . . . . . . 120 9-3 usb hub downstream port control registers (hdp1cr-hdp4cr) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121 9-4 usb sie timing interrupt register (sietir) . . . . . . . . . . . . . 123 9-5 usb sie timing status register (sietsr) . . . . . . . . . . . . . . 125 9-6 usb hub address register (haddr) . . . . . . . . . . . . . . . . . . 127 9-7 usb hub interrupt register 0 (hir0) . . . . . . . . . . . . . . . . . . 128 9-8 usb hub control register 0 (hcr0). . . . . . . . . . . . . . . . . . . 129 9-9 usb hub control register 1 (hcr1). . . . . . . . . . . . . . . . . . . 131 9-10 usb hub status register (hsr) . . . . . . . . . . . . . . . . . . . . . . 132 9-11 usb hub endpoint 0 data register (he0d0-he0d7). . . . . . 134 9-12 usb embedded device address register (daddr) . . . . . . . 138 9-13 usb embedded device interrupt register 0 (dir0). . . . . . . . 138 9-14 usb embedded device interrupt register 1 (dir1). . . . . . . . 140 9-15 usb embedded device control register 0 (dcr0). . . . . . . . 141 9-16 usb embedded device control register 1 (dcr1). . . . . . . . 143 9-17 usb embedded device status register (dsr) . . . . . . . . . . . 144 9-18 usb embedded device control register 2 (dcr2). . . . . . . . 146 9-19 usb embedded device endpoint 0 data register (ue0d0-ue0d7) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
list of figures mc68hc(7)08kh12 ? rev. 1.0 advance information motorola list of figures 19 figure title page 9-20 usb embedded device endpoint 0 data register (ue0d0-ue0d7) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148 10-1 monitor mode circuit. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151 10-2 monitor data format. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154 10-3 sample monitor waveforms . . . . . . . . . . . . . . . . . . . . . . . . . . 154 10-4 read transaction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154 10-5 break transaction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155 11-1 tim block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163 11-2 pwm period and pulse width . . . . . . . . . . . . . . . . . . . . . . . . 168 11-3 tim status and control register (tsc) . . . . . . . . . . . . . . . . . 174 11-4 tim counter registers (tcnth:tcntl) . . . . . . . . . . . . . . . . 176 11-5 tim counter modulo registers (tmodh:tmodl). . . . . . . . . 177 11-6 tim channel status and control registers (tsc0:tsc1) . . . 178 11-7 chxmax latency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181 11-8 tim channel registers (tch0h/l:tch1h/l). . . . . . . . . . . . . 182 12-1 port a data register (pta) . . . . . . . . . . . . . . . . . . . . . . . . . . 186 12-2 data direction register a (ddra) . . . . . . . . . . . . . . . . . . . . . 187 12-3 port a i/o circuit. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187 12-4 port b data register (ptb) . . . . . . . . . . . . . . . . . . . . . . . . . . 188 12-5 data direction register b (ddrb) . . . . . . . . . . . . . . . . . . . . . 189 12-6 port b i/o circuit. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189 12-7 port c data register (ptc) . . . . . . . . . . . . . . . . . . . . . . . . . . 190 12-8 data direction register c (ddrc) . . . . . . . . . . . . . . . . . . . . . 191 12-9 port c i/o circuit. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192 12-10 port d data register (ptd) . . . . . . . . . . . . . . . . . . . . . . . . . . 193 12-11 data direction register d (ddrd) . . . . . . . . . . . . . . . . . . . . . 194 12-12 port d i/o circuit. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194 12-13 port e data register (pte) . . . . . . . . . . . . . . . . . . . . . . . . . . 195 12-14 data direction register e (ddre) . . . . . . . . . . . . . . . . . . . . . 197 12-15 port e i/o circuit. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197 12-16 optical interface enable register e (eoier) . . . . . . . . . . . . . 198 12-17 optical interface voltage references . . . . . . . . . . . . . . . . . . . 200 12-18 port e optical coupling interface . . . . . . . . . . . . . . . . . . . . . . 201 12-19 port f data register (ptf). . . . . . . . . . . . . . . . . . . . . . . . . . . 202
list of figures advance information mc68hc(7)08kh12 ? rev. 1.0 20 list of figures motorola figure title page 12-20 data direction register f (ddrf) . . . . . . . . . . . . . . . . . . . . . 203 12-21 port f i/o circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203 12-22 port option control register (poc) . . . . . . . . . . . . . . . . . . . . 204 13-1 cop block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208 13-2 configuration register (config). . . . . . . . . . . . . . . . . . . . . . 210 13-3 cop control register (copctl) . . . . . . . . . . . . . . . . . . . . . . 211 14-1 irq module block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . 215 14-2 irq status and control register (iscr) . . . . . . . . . . . . . . . . 217 15-1 port-d keyboard interrupt block diagram . . . . . . . . . . . . . . . 222 15-2 port-d keyboard status and control register (kbdscr) . . . 225 15-3 port-d keyboard interrupt enable register (kbdier) . . . . . . 226 15-4 port-e keyboard interrupt block diagram . . . . . . . . . . . . . . . 228 15-5 port-e keyboard status and control register (kbescr) . . . 231 15-6 port-e keyboard interrupt enable register (kbeier) . . . . . . 232 15-7 port-f keyboard interrupt block diagram. . . . . . . . . . . . . . . . 234 15-8 port-f keyboard status and control register (kbfscr) . . . 237 15-9 port-f keyboard interrupt enable register (kbfier) . . . . . . 238 15-10 port f pull-up enable register (pfper) . . . . . . . . . . . . . . . . 239 16-1 break module block diagram . . . . . . . . . . . . . . . . . . . . . . . . . 243 16-2 break status and control register (brkscr). . . . . . . . . . . . 245 16-3 break address registers (brkh and brkl) . . . . . . . . . . . . . 246 18-1 64-pin quad-flat-pack (case 840c-04). . . . . . . . . . . . . . . . . 260
mc68hc(7)08kh12 ? rev. 1.0 advance information motorola list of tables 21 advance information ?mc68hc(7)08kh12 list of tables table title page 2-1 vector addresses ..................................................................... 43 7-1 signal name conventions ........................................................ 65 7-2 pin bit set timing .................................................................... 67 7-3 interrupt sources ...................................................................... 76 7-4 sim registers ........................................................................... 83 8-1 cgm numeric example ............................................................ 95 8-2 cgm i/o register summary................................................... 101 8-3 pre[1:0] programming........................................................... 104 9-1 hub control register summary............................................. 117 9-2 hub data register summary................................................. 119 9-3 embedded device control register summary ....................... 135 9-4 embedded device data register summary ........................... 136 10-1 mode selection ...................................................................... 152 10-2 mode differences.................................................................... 153 10-3 read (read memory) command .......................................... 156 10-4 write (write memory) command......................................... 156 10-5 iread (indexed read) command ......................................... 157 10-6 iwrite (indexed write) command ........................................ 157 10-7 readsp (read stack pointer) command ............................. 158 10-8 run (run user program) command ..................................... 158 10-9 monitor baud rate selection .................................................. 159 11-1 tim i/o register summary ..................................................... 164 11-2 prescaler selection................................................................. 175 11-3 mode, edge, and level selection ........................................... 180
list of tables advance information mc68hc(7)08kh12 ? rev. 1.0 22 list of tables motorola table title page 12-1 i/o port register summary..................................................... 184 12-2 port a pin functions ............................................................... 188 12-3 port b pin functions ............................................................... 190 12-4 port c pin functions............................................................... 192 12-5 port d pin functions............................................................... 195 12-6 port e pin functions ............................................................... 198 12-7 port f pin functions ............................................................... 204 13-1 cop i/o port register summary............................................ 208 14-1 irq i/o port register summary ............................................. 215 15-1 kbi i/o register summary ..................................................... 221 16-1 break i/o register summary.................................................. 243
mc68hc(7)08kh12 ? rev. 1.0 advance information motorola general description 23 advance information ?mc68hc(7)08kh12 section 1. general description 1.1 contents 1.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 1.3 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 1.4 mcu block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 1.5 pin assignments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 1.5.1 quad flat pack (qfp) package . . . . . . . . . . . . . . . . . . . . . 28 1.5.2 power supply pins (v dda , v ssa , v dd1 , v ss1 , v dd2 , and v ss2 ) . . . . . . . . . . 29 1.5.3 oscillator pins (osc1 and osc2) . . . . . . . . . . . . . . . . . . . 30 1.5.4 external reset pin (rst ) . . . . . . . . . . . . . . . . . . . . . . . . . . 30 1.5.5 external interrupt pin (irq1 /v pp ) . . . . . . . . . . . . . . . . . . . . 30 1.5.6 usb data pins (dplus0?plus4 and dminus0?minus4). . . . . . . 30 1.5.7 voltage regulator out (regout) . . . . . . . . . . . . . . . . . . . 30 1.5.8 port a input/output (i/o) pins (pta7?ta0) . . . . . . . . . . . 31 1.5.9 port b i/o pins (ptb7?tb0) . . . . . . . . . . . . . . . . . . . . . . . 31 1.5.10 port c i/o pins (ptc4?tc0). . . . . . . . . . . . . . . . . . . . . . . 31 1.5.11 port d i/o pins (ptd7/kbd7?td0/kbd0) . . . . . . . . . . . . 31 1.5.12 port e i/o pins (pte4, pte3/kbe3, pte2/kbe2/tch1, pte1/kbe1/tch0, pte0/kbe0/tclk) . . . . . . . . . . . . . 31 1.5.13 port f i/o pins (ptf7/kbf7?tf0/kbf0) . . . . . . . . . . . . . 32
general description advance information mc68hc(7)08kh12 ? rev. 1.0 24 general description motorola 1.2 introduction the mc68hc(7)08kh12 is a member of the low-cost, high-performance m68hc08 family of 8-bit microcontroller units (mcus). the m68hc08 family is based on the customer-specified integrated circuit (csic) design strategy. all mcus in the family use the enhanced m68hc08 central processor unit (cpu08) and are available with a variety of modules, memory sizes and types, and package types. 1.3 features features of the mc68hc(7)08kh12 include the following: high-performance m68hc08 architecture fully upward-compatible object code with m6805, m146805, and m68hc05 families 6 mhz internal bus operation low-power design (fully static with stop and wait modes) 12 kbytes of user rom (MC68HC08KH12) or one-time programmable (otp) rom (mc68hc708kh12) on-chip programming firmware for use with host personal computer rom/otprom data security 1 384 bytes of on-chip random access memory (ram) 42 general purpose i/o, 29 with software configurable pullups 16-bit, 2-channel timer interface module (tim) 20-bit keyboard interrupt port 5 led direct drive port pins 48mhz phase-locked loop 1. no security feature is absolutely secure. however, motorola? strategy is to make reading or copying the rom/otprom difficult for unauthorized users.
general description features mc68hc(7)08kh12 ? rev. 1.0 advance information motorola general description 25 full universal serial bus specification 1.1 composite hub with embedded 1 functions: ? 12mhz upstream port ? 12mhz/1.5mhz downstream ports ? hub control endpoint (endpoint0) with 8 byte transmit buffer and 8 byte receive buffer ? hub interrupt endpoint (endpoint1) with 1 byte transmit buffer ? device control endpoint (endpoint0) with 8 byte transmit buffer and 8 byte receive buffer device interrupt endpoints (endpoint1 and endpoint2) share with 8 byte transmit buffer on-chip 3.3v regulator for usb transceiver system protection features optional computer operating properly (cop) reset illegal opcode detection with optional reset illegal address detection with optional reset master reset pin with internal pullup and power-on reset an external asynchronous interrupt pin with internal pullup (irq1 ) 64-pin plastic quad flatpack (qfp) package 1. embedded device supports only bulk and interrupt transfers, and does not support isochronous transfers.
general description advance information mc68hc(7)08kh12 ? rev. 1.0 26 general description motorola features of the cpu08 include the following: enhanced hc05 programming model extensive loop control functions 16 addressing modes (eight more than the hc05) 16-bit index register and stack pointer memory-to-memory data transfers fast 8 8 multiply instruction fast 16/8 divide instruction binary-coded decimal (bcd) instructions optimization for controller applications third party c language support 1.4 mcu block diagram figure 1-1 shows the structure of the mc68hc(7)08kh12.
mc68hc(7)08kh12 ? rev. 1.0 advance information motorola general description 27 general description mcu block diagram figure 1-1. mcu block diagram ds port 1 ports are software configurable with pullup device if input port software configurable led direct drive 3ma source /10ma sink or standard drive a pin contains integrated pullup device ? pin has interrupt capability ? pin has interrupt and integrated pullup device. ? pin has optical coupling interface osc1 osc2 rst a irq1 /vpp a? vdd1 vss1 ptc4?tc0 regout ptb7?tb0 pta7?ta0 pte3/kbe3 pte0/kbe0 ?? vdd2 vss2 vssa vdda cgmxfc dplus4 tch0/pte1 tch1/pte2 tclk/pte0 port c ddrc port b ddrb port a ddra port d ddrd port e ddre port f ddrf embedded usb function 384 bytes ram 12k-bytes rom/otprom 68hc08 cpu cpu control alu cpu registers accumulator index register stack pointer program counter condition code register v11h i nzc dminus4 dplus3 dminus3 dplus2 dminus2 dplus1 dminus1 dplus0 us port dminus0 monitor rom 240 bytes cop module timer interface module power-on reset module break module irq module system integration module clock generation module and pll power supply and voltage regulation ptd7/kbd7 ptd0/kbd0 ? ds port 2 ds port 3 ds port 4 ptf7/kbf7 ptf0/kbf0 ? pte4
general description advance information mc68hc(7)08kh12 ? rev. 1.0 28 general description motorola 1.5 pin assignments 1.5.1 quad flat pack (qfp) package figure 1-2 shows the 64-pin qfp assignments. figure 1-2. 64-pin qfp assignments (top view) dminus0 dplus0 regout vssa osc2 osc1 cgmxfc vdda dplus1 dminus1 dplus2 dminus2 dplus3 1 2 3 4 5 6 7 8 9 10 11 12 13 dminus3 dplus4 dminus4 14 15 16 ptb4 ptb5 ptb6 ptb7 pta0 pta1 pta2 pta3 ptb3 ptb2 ptb1 ptb0 ptd7/kbd7 47 46 45 44 42 42 41 40 39 38 37 36 ptd6/kbd6 ptd5/kbd5 ptd4/kbd4 35 34 33 ptf5/kbf5 ptf4/kbf4 ptf3/kbf3 ptf2/kbf2 ptf1/kbf1 ptf0/kbf0 rst irq1 /vpp ptf6/kbf6 ptf7/kbf7 vss2 vdd2 pta7 63 62 61 60 59 58 57 56 55 54 53 52 pta6 pta5 pta4 51 50 49 ptc0 vdd1 vss1 pte0/kbe0/tclk pte1/kbe1/tch0 pte2/kbe2/tch1 pte3/kbe3 pte4 ptc1 ptc2 ptc3 ptc4 ptd0/kbd0 18 19 20 21 22 23 24 25 26 27 28 29 ptd1/kbd1 ptd2/kbd2 ptd3/kbd3 30 31 32 64 17 48 68hc(7)08kh12
general description pin assignments mc68hc(7)08kh12 ? rev. 1.0 advance information motorola general description 29 1.5.2 power supply pins (v dda , v ssa , v dd1 , v ss1 , v dd2 , and v ss2 ) v dda and v ssa are the analog power supply and ground pins used by the on-chip phase-locked loop circuit. v dd2 and v ss2 are the power supply and ground pins used by the internal circuitry of the chip. v dd1 and v ss1 are the power supply and ground pins to the i/o pads. the mcu operates from a single power supply. fast signal transitions on mcu pins place high, short-duration current demands on the power supply. to prevent noise problems, take special care to provide power supply bypassing at the mcu as figure 1-3 shows. place the bypass capacitors as close to the mcu power pins as possible. use high-frequency-response ceramic capacitors for c bypass . c bulk are optional bulk current bypass capacitors for use in applications that require the port pins to source high current levels. figure 1-3. power supply bypassing mcu c bulk c bypass 10 nf v ss1 + note: values shown are typical values. v dd2 c bypass 10 nf v dd2 c bypass 10 nf v ss2 v ssa v dda vbus
general description advance information mc68hc(7)08kh12 ? rev. 1.0 30 general description motorola 1.5.3 oscillator pins (osc1 and osc2) the osc1 and osc2 pins are the connections for the on-chip oscillator circuit. (see section 8. clock generator module (cgm) .) 1.5.4 external reset pin (rst ) a logic zero on the rst pin forces the mcu to a known start-up state. rst is bidirectional, allowing a reset of the entire system. it is driven low when any internal reset source is asserted. the rst pin contains an internal pullup device. ( (see section 7. system integration module (sim) .) 1.5.5 external interrupt pin (irq1 /v pp ) irq1 /v pp is an asynchronous external interrupt pin. irq1 /v pp is also the otprom programming power pin. the irq1 /v pp pin contain an internal pullup device. (see section 14. external interrupt (irq) .) 1.5.6 usb data pins (dplus0?plus4 and dminus0?minus4) dplus0?plus4 and dminus0?minus4 are the differential data lines used by the usb module. (see section 9. universal serial bus module (usb) .) 1.5.7 voltage regulator out (regout) regout is the 3.3v output of the on-chip voltage regulator. it is used to supply the voltage for the external pullup resistor required by the usb on either dplus or dminus lines, depending on type of usb function. regout is also used internally for the usb data driver and the phase- locked loop circuit. the regout pin requires an external bulk capacitor 1 m f or larger and a bypass capacitor. (see section 9. universal serial bus module (usb) .)
general description pin assignments mc68hc(7)08kh12 ? rev. 1.0 advance information motorola general description 31 1.5.8 port a input/output (i/o) pins (pta7?ta0) pta7?ta0 are general-purpose bidirectional i/o port pins. (see section 12. i/o ports .) each pin contains a software configurable pull- up device when the pin is configured as an input. (see 12.9 port options .) 1.5.9 port b i/o pins (ptb7?tb0) ptb7?tb0 are general-purpose bidirectional i/o port pins. (see section 12. i/o ports .) each pin contains a software configurable pull- up device when the pin is configured as an input. (see 12.9 port options .) 1.5.10 port c i/o pins (ptc4?tc0) ptc4?tc0 are general-purpose bidirectional i/o port pins. (see section 12. i/o ports .) port c pins are software configurable to be led direct drive ports. each pin contains a software configurable pull-up device when the pin is configured as an input. (see 12.9 port options .) 1.5.11 port d i/o pins (ptd7/kbd7?td0/kbd0) ptd7/kbd7?td0/kbd0 are general-purpose bidirectional i/o port pins. (see section 12. i/o ports .) any or all of the port d pins can be programmed to serve as external interrupt pins. (see section 15. keyboard interrupt module (kbi) .) 1.5.12 port e i/o pins (pte4, pte3/kbe3, pte2/kbe2/tch1, pte1/kbe1/tch0, pte0/kbe0/tclk) port-e is a 5-bit special function port which shares three of its pins with the timer interface module and four of its pins with keyboard interrupt module ( see section 12. i/o ports , section 15. keyboard interrupt module (kbi) and section 11. timer interface module (tim) ). in addition, pte3-pte0 has built-in optical coupling interface for optical mouse application. (see section 12. i/o ports .)
general description advance information mc68hc(7)08kh12 ? rev. 1.0 32 general description motorola 1.5.13 port f i/o pins (ptf7/kbf7?tf0/kbf0) ptf7/kbf7?tf0/kbf0 are general-purpose bidirectional i/o port pins. (see section 12. i/o ports .) any or all of the port f pins can be programmed to serve as external interrupt pins. (see section 15. keyboard interrupt module (kbi) .)
mc68hc(7)08kh12 ? rev. 1.0 advance information motorola memory map 33 advance information ?mc68hc(7)08kh12 section 2. memory map 2.1 contents 2.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 2.3 i/o section . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 2.4 monitor rom . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 2.2 introduction the cpu08 can address 64 kbytes of memory space. the memory map, shown in figure 2-1 , includes: 11776 bytes of rom or otprom 384 bytes of ram 26 bytes of user-defined vectors 240 bytes of monitor rom
memory map advance information mc68hc(7)08kh12 ? rev. 1.0 34 memory map motorola $0000 $005f i/o registers (80 bytes) $0060 $01df ram (384 bytes) $01e0 $cdff unimplemented (52, 256 bytes) $d000 $fdff rom/otprom (11776 bytes) $fe00 break status register (bsr) $fe01 reset status register (rsr) $fe02 reserved $fe03 break flag control register (bfcr) $fe04 interrupt status register 1 (int1) $fe05 interrupt status register 2 (int2) $fe06 reserved $fe07 reserved $fe08 $fe0b reserved (4 bytes) $fe0c break address high register (brkh) $fe0d break address low register (brkl) $fe0e break status and control register (bscr) $fe0f reserved $fe10 $feff monitor rom (240 bytes) $ff00 $ff00 to $ff8c unimplemented (141 bytes) $ff8d reserved $ffe5 $ff8e to $ffe5 unimplemented (88 bytes) $ffe6 $ffff vectors (26 bytes) figure 2-1. memory map
memory map i/o section mc68hc(7)08kh12 ? rev. 1.0 advance information motorola memory map 35 2.3 i/o section addresses $0000?005f, shown in figure 2-2 , contain most of the control, status, and data registers. additional i/o registers have the following addresses: $fe00 (break status register, bsr) $fe01 (reset status register, rsr) $fe02 (reserved) $fe03 (break flag control register, bfcr) $fe04 (interrupt status register 1, int1) $fe05 (interrupt status register 2, int2) $fe06 (reserved) $fe07 (reserved) $fe08 (reserved) $fe09 (reserved) $fe0a (reserved) $fe0b (reserved) $fe0c and $fe0d (break address registers, brkh and brkl) $fe0e (break status and control register, bscr) $ff8d (reserved) $ffff (cop control register, copctl)
memory map advance information mc68hc(7)08kh12 ? rev. 1.0 36 memory map motorola addr. name bit 7 654321 bit 0 $0000 port a data register (pta) r: pta7 pta6 pta5 pta4 pta3 pta2 pta1 pta0 w: $0001 port b data register (ptb) r: ptb7 ptb6 ptb5 ptb4 ptb3 ptb2 ptb1 ptb0 w: $0002 port c data register (ptc) r:000 ptc4 ptc3 ptc2 ptc1 ptc0 w: $0003 port d data register (ptd) r: ptd7 ptd6 ptd5 ptd4 ptd3 ptd2 ptd1 ptd0 w: $0004 data direction register a (ddra) r: ddra7 ddra6 ddra5 ddra4 ddra3 ddra2 ddra1 ddra0 w: $0005 data direction register b (ddrb) r: ddrb7 ddrb6 ddrb5 ddrb4 ddrb3 ddrb2 ddrb1 ddrb0 w: $0006 data direction register c (ddrc) r:000 ddrc4 ddrc3 ddrc2 ddrc1 ddrc0 w: $0007 data direction register d (ddrd) r: ddrd7 ddrd6 ddrd5 ddrd4 ddrd3 ddrd2 ddrd1 ddrd0 w: $0008 port e data register (pte) r:000 pte4 pte3 pte2 pte1 pte0 w: $0009 port f data register (ptf) r: ptf7 ptf6 ptf5 ptf4 ptf3 ptf2 ptf1 ptf0 w: $000a data direction register e (ddre) r:000 ddre4 ddre3 ddre2 ddre1 ddre0 w: $000b data direction register f (ddrf) r: ddrf7 ddrf6 ddrf5 ddrf4 ddrf3 ddrf2 ddrf1 ddrf0 w: $000c port d keyboard status and control register (kbdscr) r:0000 keydf 0 imaskd moded w: ackd $000d port d keyboard interrupt enable register (kbdier) r: kbdie7 kbdie6 kbdie5 kbdie4 kbdie3 kbdie2 kbdie1 kbdie0 $000e port e keyboard status and control register (kbescr) r:0000 keyef 0 imaske modee w: acke $000f port e keyboard interrupt enable register (kbeier) r: pepe3 pepe2 pepe1 pepe0 kbeie3 kbeie2 kbeie1 kbeie0 w: = unimplemented r = reserved figure 2-2. control, status, and data registers
memory map i/o section mc68hc(7)08kh12 ? rev. 1.0 advance information motorola memory map 37 $0010 tim status and control register (tsc) r: tof toie tstop 00 ps2 ps1 ps0 w: 0 trst $0011 unimplemented r: w: $0012 tim counter register high (tcnth) r: bit 15 14 13 12 11 10 9 bit 8 w: $0013 tim counter register low (tcntl) r: bit 7 654321 bit 0 w: $0014 tim counter modulo register high (tmodh) r: bit 15 14 13 12 11 10 9 bit 8 w: $0015 tim counter modulo register low (tmodl) r: bit 7 654321 bit 0 w: $0016 tim channel 0 status and control register (tsc0) r: ch0f ch0ie ms0b ms0a els0b els0a tov0 ch0max w: 0 $0017 tim channel 0 register high (tch0h) r: bit 15 14 13 12 11 10 9 bit 8 w: $0018 tim channel 0 register low (tch0l) r: bit 7 654321 bit 0 w: $0019 tim channel 1 status and control register (tsc1) r: ch1f ch1ie 0 ms1a els1b els1a tov1 ch1max w: 0 $001a tim channel 1 register high (tch1h) r: bit 15 14 13 12 11 10 9 bit 8 $001b tim channel 1 register low (tch1l) r: bit 7 654321 bit 0 w: $001c port e optical interface enable register (eoier) r: yref2 yref1 yref0 xref2 xref1 xref0 oiey oiex w: $001d port option control register (poc) r: 0 0 ldd 00 pcp pbp pap w: $001e irq status and control register (iscr) r:0000 irqf1 0 imask1 mode1 w ack1 $001f con?uration register (config) ? r:0000 ssrec coprs stop copd w: ? one-time writable register addr. name bit 7 654321 bit 0 = unimplemented r = reserved figure 2-2. control, status, and data registers (continued)
memory map advance information mc68hc(7)08kh12 ? rev. 1.0 38 memory map motorola $0020 usb embedded device endpoint 0 data register 0 (de0d0) r: de0r07 de0r06 de0r05 de0r04 de0r03 de0r02 de0r01 de0r00 w: de0t07 de0t06 de0t05 de0t04 de0t03 de0t02 de0t01 de0t00 $0021 usb embedded device endpoint 0 data register 1 (de0d1) r: de0r17 de0r16 de0r15 de0r14 de0r13 de0r12 de0r11 de0r10 w: de0t17 de0t16 de0t15 de0t14 de0t13 de0t12 de0t11 de0t10 $0022 usb embedded device endpoint 0 data register 2 (de0d2) r: de0r27 de0r26 de0r25 de0r24 de0r23 de0r22 de0r21 de0r20 w: de0t27 de0t26 de0t25 de0t24 de0t23 de0t22 de0t21 de0t20 $0023 usb embedded device endpoint 0 data register 3 (de0d3) r: de0r37 de0r36 de0r35 de0r34 de0r33 de0r32 de0r31 de0r30 w: de0t37 de0t36 de0t35 de0t34 de0t33 de0t32 de0t31 de0t30 $0024 usb embedded device endpoint 0 data register 4 (de0d4) r: de0r47 de0r46 de0r45 de0r44 de0r43 de0r42 de0r41 de0r40 w: de0t47 de0t46 de0t45 de0t44 de0t43 de0t42 de0t41 de0t40 $0025 usb embedded device endpoint 0 data register 5 (de0d5) r: de0r57 de0r56 de0r55 de0r54 de0r53 de0r52 de0r51 de0r50 w: de0t57 de0t56 de0t55 de0t54 de0t53 de0t52 de0t51 de0t50 $0026 usb embedded device endpoint 0 data register 6 (de0d6) r: de0r67 de0r66 de0r65 de0r64 de0r63 de0r62 de0r61 de0r60 w: de0t67 de0t66 de0t65 de0t64 de0t63 de0t62 de0t61 de0t60 $0027 usb embedded device endpoint 0 data register 7 (de0d7) r: de0r77 de0r76 de0r75 de0r74 de0r73 de0r72 de0r71 de0r70 w: de0t77 de0t76 de0t75 de0t74 de0t73 de0t72 de0t71 de0t70 $0028 usb embedded device endpoint 1/2 data register 0 (de1d0) r: w: de1t07 de1t06 de1t05 de1t04 de1t03 de1t02 de1t01 de1t00 $0029 usb embedded device endpoint 1/2 data register 1 (de1d1) r: w: de1t17 de1t16 de1t15 de1t14 de1t13 de1t12 de1t11 de1t10 $002a usb embedded device endpoint 1/2 data register 2 (de1d2) r: w: de1t27 de1t26 de1t25 de1t24 de1t23 de1t22 de1t21 de1t20 $002b usb embedded device endpoint 1/2 data register 3 (de1d3) r: w: de1t37 de1t36 de1t35 de1t34 de1t33 de1t32 de1t31 de1t30 $002c usb embedded device endpoint 1/2 data register 4 (de1d4) r: w: de1t47 de1t46 de1t45 de1t44 de1t43 de1t42 de1t41 de1t40 $002d usb embedded device endpoint 1/2 data register 5 (de1d5) r: w: de1t57 de1t56 de1t55 de1t54 de1t53 de1t52 de1t51 de1t50 $002e usb embedded device endpoint 1/2 data register 6 (de1d6) r: w: de1t67 de1t66 de1t65 de1t64 de1t63 de1t62 de1t61 de1t60 $002f usb embedded device endpoint 1/2 data register 7 (de1d7) r: w: de1t77 de1t76 de1t75 de1t74 de1t73 de1t72 de1t71 de1t70 addr. name bit 7 654321 bit 0 = unimplemented r = reserved figure 2-2. control, status, and data registers (continued)
memory map i/o section mc68hc(7)08kh12 ? rev. 1.0 advance information motorola memory map 39 $0030 usb hub endpoint 0 data register 0 (he0d0) r: he0r07 he0r06 he0r05 he0r04 he0r03 he0r02 he0r01 he0r00 w: he0t07 he0t06 he0t05 he0t04 he0t03 he0t02 he0t01 he0t00 $0031 usb hub endpoint 0 data register 1 (he0d1) r: he0r17 he0r16 he0r15 he0r14 he0r13 he0r12 he0r11 he0r10 w: he0t17 he0t16 he0t15 he0t14 he0t13 he0t12 he0t11 he0t10 $0032 usb hub endpoint 0 data register 2 (he0d2) r: he0r27 he0r26 he0r25 he0r24 he0r23 he0r22 he0r21 he0r20 w: he0t27 he0t26 he0t25 he0t24 he0t23 he0t22 he0t21 he0t20 $0033 usb hub endpoint 0 data register 3 (he0d3) r: he0r37 he0r36 he0r35 he0r34 he0r33 he0r32 he0r31 he0r30 w: he0t37 he0t36 he0t35 he0t34 he0t33 he0t32 he0t31 he0t30 $0034 usb hub endpoint 0 data register 4 (he0d4) r: he0r47 he0r46 he0r45 he0r44 he0r43 he0r42 he0r41 he0r40 w: he0t47 he0t46 he0t45 he0t44 he0t43 he0t42 he0t41 he0t40 $0035 usb hub endpoint 0 data register 5 (he0d5) r: he0r57 he0r56 he0r55 he0r54 he0r53 he0r52 he0r51 he0r50 w: he0t57 he0t56 he0t55 he0t54 he0t53 he0t52 he0t51 he0t50 $0036 usb hub endpoint 0 data register 6 (he0d6) r: he0r67 he0r66 he0r65 he0r64 he0r63 he0r62 he0r61 he0r60 w: he0t67 he0t66 he0t65 he0t64 he0t63 he0t62 he0t61 he0t60 $0037 usb hub endpoint 0 data register 7 (he0d7) r: he0r77 he0r76 he0r75 he0r74 he0r73 he0r72 he0r71 he0r70 w: he0t77 he0t76 he0t75 he0t74 he0t73 he0t72 he0t71 he0t70 $0038 unimplemented r: w: $0039 unimplemented r: w: $003a pll control register (pctl) r: pllie pllf pllon bcs pre1 pre0 0 0 w: $003b pll bandwidth control register (pbwc) r: auto lock a cq 00000 w: $003c pll multiplier select register high (pmsh) r: mul11 mul10 mul9 mul8 w: $003d pll multiplier select register low (pmsl) r: mul7 mul6 mul5 mul4 mul3 mul2 mul1 mul0 w: $003e unimplemented r: w: $003f pll reference divider select register (prds) r: rds3 rds2 rds1 rds0 w: addr. name bit 7 654321 bit 0 = unimplemented r = reserved figure 2-2. control, status, and data registers (continued)
memory map advance information mc68hc(7)08kh12 ? rev. 1.0 40 memory map motorola $0040 port f keyboard status and control register (kbfscr) r:0000 keyff 0 imaskf modef w: ackf $0041 port f keyboard interrupt enable register (kbfier) r: kbfie7 kbfie6 kbfie5 kbfie4 kbfie3 kbfie2 kbfie1 kbfie0 w: $0042 port f pull-up enable register (pfper) r: pfpe7 pfpe6 pfpe5 pfpe4 pfpe3 pfpe2 pfpe1 pfpe0 w: $0043 unimplemented r: w: $0044 unimplemented r: w: $0045 unimplemented r: w: $0046 unimplemented r: w: $0047 usb embedded device control register 2 (dcr2) r:0000 enable2 enable1 dstall2 dstall1 w: $0048 usb embedded device address register (daddr) r: deven dadd6 dadd5 dadd4 dadd3 dadd2 dadd1 dadd0 w: $0049 usb embedded device interrupt register 0 (dir0) r: txd0f rxd0f 0 0 txd0ie rxd0ie 00 w: txd0fr rxd0fr $004a usb embedded device interrupt register 1 (dir1) r: txd1f 0 0 0 txd1ie 000 w: txd1fr $004b usb embedded device control register 0 (dcr0) r: t0seq dstall0 tx0e rx0e tp0siz3 tp0siz2 tp0siz1 tp0siz0 w: $004c usb embedded device control register 1 (dcr1) r: t1seq endadd tx1e 0 tp1siz3 tp1siz2 tp1siz1 tp1siz0 w: $004d usb embedded device status register (dsr) r: drseq dsetup dtx1st 0 rp0siz3 rp0siz2 rp0siz1 rp0siz0 w: dtx1str $004e unimplemented r: w: $004f unimplemented r: w: addr. name bit 7 654321 bit 0 = unimplemented r = reserved figure 2-2. control, status, and data registers (continued)
memory map i/o section mc68hc(7)08kh12 ? rev. 1.0 advance information motorola memory map 41 $0050 unimplemented r: w: $0051 usb hub downstream port 1 control register (hdp1cr) r: pen1 lowsp1 rst1 resum1 susp1 0 d1+ d1 w: $0052 usb hub downstream port 2 control register (hdp2cr) r: pen2 lowsp2 rst2 resum2 susp2 0 d2+ d2 w: $0053 usb hub downstream port 3 control register (hdp3cr) r: pen3 lowsp3 rst3 resum3 susp3 0 d3+ d3 w: $0054 usb hub downstream port 4 control register (hdp4cr) r: pen4 lowsp4 rst4 resum4 susp4 0 d4+ d4 w: $0055 unimplemented r: w: $0056 usb sie timing interrupt register (sietir) r: soff eof2f eopf tranf sofie eof2ie eopie tranie w: $0057 usb sie timing status register (sietsr) r: rstf 0 lockf 00000 w: rstfr lockfr soffr eof2fr eopfr tranfr $0058 usb hub address register (haddr) r: usben add6 add5 add4 add3 add2 add1 add0 w: $0059 usb hub interrupt register 0 (hir0) r: txdf rxdf 0 0 txdie rxdie 00 w: txdfr rxdfr $005a unimplemented r: w: $005b usb hub control register 0 (hcr0) r: tseq stall0 txe rxe tpsiz3 tpsiz2 tpsiz1 tpsiz0 w: $005c usb hub endpoint1 control & data register (hcdr) r: stall1 pnew pchg5 pchg4 pchg3 pchg2 pchg1 pchg0 w: $005d usb hub status register (hsr) r: rseq setup tx1st 0 rpsiz3 rpsiz2 rpsiz1 rpsiz0 w: tx1str $005e usb hub root port control register (hrpcr) r:000 resum0 suspnd 0 d0+ d0 w: $005f unimplemented r: w: addr. name bit 7 654321 bit 0 = unimplemented r = reserved figure 2-2. control, status, and data registers (continued)
memory map advance information mc68hc(7)08kh12 ? rev. 1.0 42 memory map motorola $fe00 break status register (bsr) r: rrrrrr sbsw r w: $fe01 reset status register (rsr) r: por pin cop ilop ilad usb 0 0 w: $fe02 reserved r: w: $fe03 break flag control register (bfcr) r: bcfe rrrrrrr w: $fe04 interrupt status register 1 (int1) r: if6 if5 if4 if3 if2 if1 0 0 w:rrrrrrrr $fe05 interrupt status register 2 (int2) r: 0 0 0 if11 if10 if9 if8 if7 w:rrrrrrrr $fe06 reserved r: w: $fe07 reserved r: w: $fe08 unimplemented r: w: $fe09 unimplemented r: w: $fe0a unimplemented r: w: $fe0b unimplemented r: w: $fe0c break address register high (brkh) r: bit 15 14 13 12 11 10 9 bit 8 w: $fe0d break address register low (brkl) r: bit 7 654321 bit 0 w: $fe0e break status and control register (brkscr) r: brke brka 000000 w: $ff8d reserved r: w: $ffff cop control register (copctl) r: low byte of reset vector w: writing clears cop counter (any value) addr. name bit 7 654321 bit 0 = unimplemented r = reserved figure 2-2. control, status, and data registers (continued)
memory map monitor rom mc68hc(7)08kh12 ? rev. 1.0 advance information motorola memory map 43 table 2-1 is a list of vector locations. 2.4 monitor rom the 240 bytes at addresses $fe10?feff are reserved rom addresses that contain the instructions for the monitor functions. (see section 10. monitor rom (mon) .) table 2-1. vector addresses address vector $ffe6 pll vector (high) $ffe7 pll vector (low) $ffe8 port-f keyboard vector (high) $ffe9 port-f keyboard vector (low) $ffea port-d keyboard vector (high) $ffeb port-d keyboard vector (low) $ffec port-e keyboard vector (high) $ffed port-e keyboard vector (low) $ffee tim over?w vector (high) $ffef tim over?w vector (low) $fff0 tim channel 1 vector (high) $fff1 tim channel 1 vector (low) $fff2 tim channel 0 vector (high) $fff3 tim channel 0 vector (low) $fff4 usb device endpoint interrupt vector (high) $fff5 usb device endpoint interrupt vector (low) $fff6 usb hub endpoint interrupt vector (high) $fff7 usb hub endpoint interrupt vector (low) $fff8 usb sie timing interrupt vector (high) $fff9 usb sie timing interrupt vector (low) $fffa irq1 vector (high) $fffb irq1 vector (low) $fffc swi vector (high) $fffd swi vector (low) $fffe reset vector (high) $ffff reset vector (low) priority low high
memory map advance information mc68hc(7)08kh12 ? rev. 1.0 44 memory map motorola
mc68hc(7)08kh12 ? rev. 1.0 advance information motorola random-access memory (ram) 45 advance information ?mc68hc(7)08kh12 section 3. random-access memory (ram) 3.1 contents 3.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 3.3 functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 3.2 introduction this section describes the 384 bytes of ram. 3.3 functional description addresses $0060 through $01df are ram locations. the location of the stack ram is programmable. the 16-bit stack pointer allows the stack to be anywhere in the 64-kbyte memory space. note: for correct operation, the stack pointer must point only to ram locations. within page zero are 160 bytes of ram. because the location of the stack ram is programmable, all page zero ram locations can be used for i/o control and user data or code. when the stack pointer is moved from its reset location at $00ff, direct addressing mode instructions can access efficiently all page zero ram locations. page zero ram, therefore, provides ideal locations for frequently accessed global variables. before processing an interrupt, the cpu uses five bytes of the stack to save the contents of the cpu registers. note: for m6805 compatibility, the h register is not stacked.
random-access memory (ram) advance information mc68hc(7)08kh12 ? rev. 1.0 46 random-access memory (ram) motorola during a subroutine call, the cpu uses two bytes of the stack to store the return address. the stack pointer decrements during pushes and increments during pulls. note: be careful when using nested subroutines. the cpu may overwrite data in the ram during a subroutine or during the interrupt stacking operation.
mc68hc(7)08kh12 ? rev. 1.0 advance information motorola read-only memory (rom) 47 advance information ?mc68hc(7)08kh12 section 4. read-only memory (rom) 4.1 contents 4.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 4.3 functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 4.2 introduction this section describes the 11,776 bytes of read-only memory (rom) and 26 bytes of user vectors, available on the MC68HC08KH12 device (rom part). on the mc68hc708kh12 (otp part), the rom is replaced with 11,776 bytes one-time programmable (otp) rom. programming tools are available from motorola. contact your local motorola representative for more information. 4.3 functional description these addresses are user rom locations: $d000 ?$fdff $ffe6 ?$ffff (these locations are reserved for user-defined interrupt and reset vectors.) note: a secutiry feature prevents viewing of the rom contents. 1 1. no security feature is absolutely secure. however, motorola? strategy is to make reading or copying the rom contents difficult for unauthorized users.
read-only memory (rom) advance information mc68hc(7)08kh12 ? rev. 1.0 48 read-only memory (rom) motorola
mc68hc(7)08kh12 ? rev. 1.0 advance information motorola configuration register (config) 49 advance information ?mc68hc(7)08kh12 section 5. configuration register (config) 5.1 contents 5.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 5.3 functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 5.2 introduction this section describes the configuration register (config). the configuration register enables or disables the following options: stop mode recovery time (32 cgmxclk cycles or 4096 cgmxclk cycles) stop instruction computer operating properly module (cop) cop reset period (coprs), (2 13 ? 4 ) cgmxclk or (2 18 ? 4 ) cgmxclk 5.3 functional description the configuration register is used in the initialization of various options. the configuration register can be written once after each reset. all of the configuration register bits are cleared during reset. since the various options affect the operation of the mcu it is recommended that this register be written immediately after reset. the configuration register is located at $001f. the configuration register may be read at anytime. this configuration register exists on both the mc68hc708kh12 (otp part) and MC68HC08KH12 (rom part).
con?uration register (config) advance information mc68hc(7)08kh12 ? rev. 1.0 50 configuration register (config) motorola note: the config register is a special register containing one-time writable latches after each reset. upon a reset, the config register defaults to the predetermined settings as shown in figure 5-1 . ssrec ?short stop recovery bit ssrec enables the cpu to exit stop mode with a delay of 32 cgmxclk cycles instead of a 4096 cgmxclk cycle delay. 1 = stop mode recovery after 32 cgmxclk cycles 0 = stop mode recovery after 4096 cgmxclk cycles note: exiting stop mode by pulling reset will result in the long stop recovery. if using an external crystal, do not set the ssrec bit. coprs ?cop reset period selection bit 1 = cop reset cycle is (2 13 ? 4 ) cgmxclk 0 = cop reset cycle is (2 18 ? 4 ) cgmxclk stop ?stop instruction enable bit stop enables the stop instruction. 1 = stop instruction enabled 0 = stop instruction treated as illegal opcode copd ?cop disable bit copd disables the cop module. see section 13. computer operating properly (cop) . 1 = cop module disabled 0 = cop module enabled address: $001f bit 7 654321 bit 0 read: 0000 ssrec coprs stop copd write: reset: 00000000 = unimplemented figure 5-1. configuration register (config)
mc68hc(7)08kh12 ? rev. 1.0 advance information motorola central processor unit (cpu) 51 advance information ?mc68hc(7)08kh12 section 6. central processor unit (cpu) 6.1 contents 6.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 6.3 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 6.4 cpu registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 6.4.1 accumulator (a). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 6.4.2 index register (h:x) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 6.4.3 stack pointer (sp). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 6.4.4 program counter (pc) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 6.4.5 condition code register (ccr) . . . . . . . . . . . . . . . . . . . . . 57 6.5 arithmetic/logic unit (alu) . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 6.2 introduction this section describes the central processor unit. the m68hc08 cpu is an enhanced and fully object-code-compatible version of the m68hc05 cpu. the cpu08 reference manual (motorola document number cpu08rm/ad) contains a description of the cpu instruction set, addressing modes, and architecture.
central processor unit (cpu) advance information mc68hc(7)08kh12 ? rev. 1.0 52 central processor unit (cpu) motorola 6.3 features features of the cpu include the following: full upward, object-code compatibility with m68hc05 family 16-bit stack pointer with stack manipulation instructions 16-bit index register with x-register manipulation instructions 8-mhz cpu internal bus frequency 64-kbyte program/data memory space 16 addressing modes memory-to-memory data moves without using accumulator fast 8-bit by 8-bit multiply and 16-bit by 8-bit divide instructions enhanced binary-coded decimal (bcd) data handling modular architecture with expandable internal bus definition for extension of addressing range beyond 64 kbytes low-power stop and wait modes 6.4 cpu registers figure 6-1 shows the five cpu registers. cpu registers are not part of the memory map.
central processor unit (cpu) cpu registers mc68hc(7)08kh12 ? rev. 1.0 advance information motorola central processor unit (cpu) 53 figure 6-1. cpu registers 6.4.1 accumulator (a) the accumulator is a general-purpose 8-bit register. the cpu uses the accumulator to hold operands and the results of arithmetic/logic operations. accumulator (a) index register (h:x) stack pointer (sp) program counter (pc) condition code register (ccr) carry/borrow flag zero flag negative flag interrupt mask half-carry flag two? complement overflow flag v1 1h i nzc h x 0 0 0 0 7 15 15 15 70 bit 7 654321 bit 0 read: write: reset: unaffected by reset figure 6-2. accumulator (a)
central processor unit (cpu) advance information mc68hc(7)08kh12 ? rev. 1.0 54 central processor unit (cpu) motorola 6.4.2 index register (h:x) the 16-bit index register allows indexed addressing of a 64-kbyte memory space. h is the upper byte of the index register, and x is the lower byte. h:x is the concatenated 16-bit index register. in the indexed addressing modes, the cpu uses the contents of the index register to determine the conditional address of the operand. the index register can serve also as a temporary data storage location. bit 151413121110987654321 bit 0 read: write: reset: 00000000 xxxxxxxx x = indeterminate figure 6-3. index register (h:x)
central processor unit (cpu) cpu registers mc68hc(7)08kh12 ? rev. 1.0 advance information motorola central processor unit (cpu) 55 6.4.3 stack pointer (sp) the stack pointer is a 16-bit register that contains the address of the next location on the stack. during a reset, the stack pointer is preset to $00ff. the reset stack pointer (rsp) instruction also sets the least significant byte to $ff but does not affect the most significant byte. the stack pointer decrements as data is pushed onto the stack and increments as data is pulled from the stack. in the stack pointer 8-bit offset and 16-bit offset addressing modes, the stack pointer can function as an index register to access data on the stack. the cpu uses the contents of the stack pointer to determine the conditional address of the operand. note: the location of the stack is arbitrary and may be relocated anywhere in ram. moving the sp out of page zero ($0000 to $00ff) frees direct address (page zero) space. for correct operation, the stack pointer must point only to ram locations. bit 151413121110987654321 bit 0 read: write: reset: 0000000011111111 figure 6-4. stack pointer (sp)
central processor unit (cpu) advance information mc68hc(7)08kh12 ? rev. 1.0 56 central processor unit (cpu) motorola 6.4.4 program counter (pc) the program counter is a 16-bit register that contains the address of the next instruction or operand to be fetched. normally, the program counter automatically increments to the next sequential memory location every time an instruction or operand is fetched. jump, branch, and interrupt operations load the program counter with an address other than that of the next sequential location. during reset, the program counter is loaded with the reset vector address located at $fffe and $ffff. the vector address is the address of the first instruction to be executed after exiting the reset state. bit 151413121110987654321 bit 0 read: write: reset: loaded with vector from $fffe and $ffff figure 6-5. program counter (pc)
central processor unit (cpu) cpu registers mc68hc(7)08kh12 ? rev. 1.0 advance information motorola central processor unit (cpu) 57 6.4.5 condition code register (ccr) the 8-bit condition code register contains the interrupt mask and five flags that indicate the results of the instruction just executed. bits 6 and 5 are set permanently to logic one. the following paragraphs describe the functions of the condition code register. v ?overflow flag the cpu sets the overflow flag when a two's complement overflow occurs. the signed branch instructions bgt, bge, ble, and blt use the overflow flag. 1 = overflow 0 = no overflow h ?half-carry flag the cpu sets the half-carry flag when a carry occurs between accumulator bits 3 and 4 during an add or adc operation. the half- carry flag is required for binary-coded decimal (bcd) arithmetic operations. the daa instruction uses the states of the h and c flags to determine the appropriate correction factor. 1 = carry between bits 3 and 4 0 = no carry between bits 3 and 4 bit 7 654321 bit 0 read: v1 1h i nzc write: reset: x 1 1x1xxx x = indeterminate figure 6-6. condition code register (ccr)
central processor unit (cpu) advance information mc68hc(7)08kh12 ? rev. 1.0 58 central processor unit (cpu) motorola i ?interrupt mask when the interrupt mask is set, all maskable cpu interrupts are disabled. cpu interrupts are enabled when the interrupt mask is cleared. when a cpu interrupt occurs, the interrupt mask is set automatically after the cpu registers are saved on the stack, but before the interrupt vector is fetched. 1 = interrupts disabled 0 = interrupts enabled note: to maintain m6805 compatibility, the upper byte of the index register (h) is not stacked automatically. if the interrupt service routine modifies h, then the user must stack and unstack h using the pshh and pulh instructions. after the i bit is cleared, the highest-priority interrupt request is serviced first. a return from interrupt (rti) instruction pulls the cpu registers from the stack and restores the interrupt mask from the stack. after any reset, the interrupt mask is set and can only be cleared by the clear interrupt mask software instruction (cli). n ?negative flag the cpu sets the negative flag when an arithmetic operation, logic operation, or data manipulation produces a negative result, setting bit 7 of the result. 1 = negative result 0 = non-negative result z ?zero flag the cpu sets the zero flag when an arithmetic operation, logic operation, or data manipulation produces a result of $00. 1 = zero result 0 = non-zero result
central processor unit (cpu) arithmetic/logic unit (alu) mc68hc(7)08kh12 ? rev. 1.0 advance information motorola central processor unit (cpu) 59 c ?carry/borrow flag the cpu sets the carry/borrow flag when an addition operation produces a carry out of bit 7 of the accumulator or when a subtraction operation requires a borrow. some instructions ?such as bit test and branch, shift, and rotate ?also clear or set the carry/borrow flag. 1 = carry out of bit 7 0 = no carry out of bit 7 6.5 arithmetic/logic unit (alu) the alu performs the arithmetic and logic operations defined by the instruction set. refer to the cpu08 reference manual (motorola document number cpu08rm/ad) for a description of the instructions and addressing modes and more detail about cpu architecture.
central processor unit (cpu) advance information mc68hc(7)08kh12 ? rev. 1.0 60 central processor unit (cpu) motorola
mc68hc(7)08kh12 ? rev. 1.0 advance information motorola system integration module (sim) 61 advance information ?mc68hc(7)08kh12 section 7. system integration module (sim) 7.1 contents 7.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 7.3 sim bus clock control and generation . . . . . . . . . . . . . . . . . . 65 7.3.1 bus timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 7.3.2 clock start-up from por . . . . . . . . . . . . . . . . . . . . . . . . . . 66 7.3.3 clocks in stop mode and wait mode . . . . . . . . . . . . . . . . . 66 7.4 reset and system initialization. . . . . . . . . . . . . . . . . . . . . . . . . 66 7.4.1 external pin reset. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 7.4.2 active resets from internal sources . . . . . . . . . . . . . . . . . . 67 7.4.2.1 power-on reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 7.4.2.2 computer operating properly (cop) reset . . . . . . . . . . 69 7.4.2.3 illegal opcode reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 7.4.2.4 illegal address reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 7.4.2.5 universal serial bus reset . . . . . . . . . . . . . . . . . . . . . . . 70 7.5 sim counter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 7.5.1 sim counter during power-on reset . . . . . . . . . . . . . . . . . 71 7.5.2 sim counter during stop mode recovery . . . . . . . . . . . . . 71 7.5.3 sim counter and reset states . . . . . . . . . . . . . . . . . . . . . . 71 7.6 exception control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 7.6.1 interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 7.6.1.1 hardware interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 7.6.1.2 swi instruction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76 7.6.2 interrupt status registers . . . . . . . . . . . . . . . . . . . . . . . . . . 76 7.6.2.1 interrupt status register 1 . . . . . . . . . . . . . . . . . . . . . . . . 77 7.6.2.2 interrupt status register 2 . . . . . . . . . . . . . . . . . . . . . . . . 78 7.6.2.3 interrupt status register 3 . . . . . . . . . . . . . . . . . . . . . . . . 78 7.6.3 reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 7.6.4 break interrupts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 7.6.5 status flag protection in break mode. . . . . . . . . . . . . . . . . 79
system integration module (sim) advance information mc68hc(7)08kh12 ? rev. 1.0 62 system integration module (sim) motorola 7.7 low-power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 7.7.1 wait mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 7.7.2 stop mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 7.8 sim registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 7.8.1 break status register (bsr). . . . . . . . . . . . . . . . . . . . . . . . 83 7.8.2 reset status register (rsr) . . . . . . . . . . . . . . . . . . . . . . . 84 7.8.3 break flag control register (bfcr). . . . . . . . . . . . . . . . . . 85 7.2 introduction this section describes the system integration module (sim), which supports up to 24 external and/or internal interrupts. together with the cpu, the sim controls all mcu activities. a block diagram of the sim is shown in figure 7-1 . figure 7-2 is a summary of the sim i/o registers. the sim is a system state controller that coordinates cpu and exception timing. the sim is responsible for: bus clock generation and control for cpu and peripherals top/wait/reset/break entry and recovery internal clock control master reset control, including power-on reset (por) and cop timeout interrupt control: acknowledge timing arbitration control timing vector address generation cpu enable/disable timing modular architecture expandable to 128 interrupt sources
system integration module (sim) introduction mc68hc(7)08kh12 ? rev. 1.0 advance information motorola system integration module (sim) 63 figure 7-1. sim block diagram stop/wait clock control clock generators por control reset pin control sim reset status register interrupt control and priority decode module stop module wait cpu stop (from cpu) cpu wait (from cpu) simoscen (to cgm) cgmout (from cgm) internal clocks master reset control reset pin logic illegal opcode (from cpu) illegal address (from address map decoders) cop timeout (from cop module) interrupt sources cpu interface reset control sim counter cop clock cgmxclk (from cgm) ? 2 usb reset (from usb module)
system integration module (sim) advance information mc68hc(7)08kh12 ? rev. 1.0 64 system integration module (sim) motorola addr. register name bit 7 654321 bit 0 $fe00 break status register (bsr) read: rrrrrr sbsw r write: reset: 0 $fe01 reset status register (rsr) read: por pin cop ilop ilad usb 0 0 write: reset: 10000000 $fe03 break flag control register (bfcr) read: bcfe rrrrrrr write: reset: 0 $fe04 interrupt status register 1 (int1) read: if6 if5 if4 if3 if2 if1 0 0 write: rrrrrrrr reset: 00000000 $fe05 interrupt status register 2 (int2) read: 0 0 0 if11 if10 if9 if8 if7 write: rrrrrrrr reset: 00000000 $fe06 interrupt status register 3 (int3) read: 00000000 write: rrrrrrrr reset: 00000000 = unimplemented r = reserved for factory test figure 7-2. sim i/o register summary
system integration module (sim) sim bus clock control and generation mc68hc(7)08kh12 ? rev. 1.0 advance information motorola system integration module (sim) 65 table 7-1 shows the internal signal names used in this section. 7.3 sim bus clock control and generation the bus clock generator provides system clock signals for the cpu and peripherals on the mcu. the system clocks are generated from an incoming clock, cgmout, as shown in figure 7-3 . figure 7-3. sim clock signals 7.3.1 bus timing in user mode , the internal bus frequency is the oscillator frequency (cgmxclk) divided by four. table 7-1. signal name conventions signal name description cgmxclk buffered osc1 from the oscillator cgmout the cgmxclk frequency divided by two. this signal is again divided by two in the sim to generate the internal bus clocks (bus clock = cgmxclk divided by four) iab internal address bus idb internal data bus porrst signal from the power-on reset module to the sim irst internal reset signal r/w read/write signal ? 2 bus clock generators sim sim counter from pll/oscillator from pll/oscillator cgmout cgmxclk
system integration module (sim) advance information mc68hc(7)08kh12 ? rev. 1.0 66 system integration module (sim) motorola 7.3.2 clock start-up from por when the power-on reset module generates a reset, the clocks to the cpu and peripherals are inactive and held in an inactive phase until after the 4096 cgmxclk cycle por timeout has completed. the rst pin is driven low by the sim during this entire period. the ibus clocks start upon completion of the timeout. 7.3.3 clocks in stop mode and wait mode upon exit from stop mode by an interrupt, break, or reset, the sim allows cgmxclk to clock the sim counter. the cpu and peripheral clocks do not become active until after the stop delay timeout. this timeout is selectable as 4096 or 32 cgmxclk cycles. (see 7.7.2 stop mode .) in wait mode, the cpu clocks are inactive. the sim also produces two sets of clocks for other modules. refer to the wait mode subsection of each module to see if the module is active or inactive in wait mode. some modules can be programmed to be active in wait mode. 7.4 reset and system initialization the mcu has these reset sources: power-on reset module (por) external reset pin (rst ) computer operating properly module (cop) illegal opcode illegal address universal serial bus module (usb) all of these resets produce the vector $fffe?fff ($fefe?eff in monitor mode) and assert the internal reset signal (irst). irst causes all registers to be returned to their default values and all modules to be returned to their reset states.
system integration module (sim) reset and system initialization mc68hc(7)08kh12 ? rev. 1.0 advance information motorola system integration module (sim) 67 an internal reset clears the sim counter (see 7.5 sim counter ), but an external reset does not. each of the resets sets a corresponding bit in the reset status register (rsr). (see 7.8 sim registers .) 7.4.1 external pin reset the rst pin circuits include an internal pullup device. pulling the asynchronous rst pin low halts all processing. the pin bit of the reset status register (rsr) is set as long as rst is held low for a minimum of 67 cgmxclk cycles, assuming that the por was not the source of the reset. see table 7-2 for details. figure 7-4 shows the relative timing. figure 7-4. external reset timing 7.4.2 active resets from internal sources all internal reset sources actively pull the rst pin low for 32 cgmxclk cycles to allow resetting of external peripherals. the internal reset signal irst continues to be asserted for an additional 32 cycles. see figure 7- 5 . an internal reset can be caused by an illegal address, illegal opcode, cop timeout, or por. (see figure 7-6. sources of internal reset .) note that for por resets, the sim cycles through 4096 cgmxclk cycles during which the sim forces the rst pin low. the internal reset signal then follows the sequence from the falling edge of rst shown in figure 7-5 . table 7-2. pin bit set timing reset type number of cycles required to set pin por 4163 (4096 + 64 + 3) all others 67 (64 + 3) rst iab pc vect h vect l cgmout
system integration module (sim) advance information mc68hc(7)08kh12 ? rev. 1.0 68 system integration module (sim) motorola figure 7-5. internal reset timing the cop reset is asynchronous to the bus clock. figure 7-6. sources of internal reset the active reset feature allows the part to issue a reset to peripherals and other chips within a system built around the mcu. 7.4.2.1 power-on reset when power is first applied to the mcu, the power-on reset module (por) generates a pulse to indicate that power-on has occurred. the external reset pin (rst ) is held low while the sim counter counts out 4096 cgmxclk cycles. sixty-four cgmxclk cycles later, the cpu and memories are released from reset to allow the reset vector sequence to occur. at power-on, the following events occur: a por pulse is generated. the internal reset signal is asserted. the sim enables the oscillator to drive cgmxclk. internal clocks to the cpu and modules are held inactive for 4096 cgmxclk cycles to allow stabilization of the oscillator. the rst pin is driven low during the oscillator stabilization time. the por bit of the reset status register (rsr) is set and all other bits in the register are cleared. irst rst r s t pulled low by mcu iab 32 cycles 32 cycles vector high cgmxclk illegal address rst illegal opcode rst coprst por internal reset usb
system integration module (sim) reset and system initialization mc68hc(7)08kh12 ? rev. 1.0 advance information motorola system integration module (sim) 69 figure 7-7. por recovery 7.4.2.2 computer operating properly (cop) reset an input to the sim is reserved for the cop reset signal. the overflow of the cop counter causes an internal reset and sets the cop bit in the reset status register (rsr). the sim actively pulls down the rst pin for all internal reset sources. to prevent a cop module timeout, write any value to location $ffff. writing to location $ffff clears the cop counter and stages 12 through 5 of the sim counter. the sim counter output, which occurs at least every 2 12 ?2 4 cgmxclk cycles, drives the cop counter. the cop should be serviced as soon as possible out of reset to guarantee the maximum amount of time before the first timeout. the cop module is disabled if the rst pin or the irq1 /v pp pin is held at v dd + v hi while the mcu is in monitor mode. the cop module can be disabled only through combinational logic conditioned with the high voltage signal on the rst or the irq1 /v pp pin. this prevents the cop from becoming disabled as a result of external noise. during a break state, v dd + v hi on the rst pin disables the cop module. porrst osc1 cgmxclk cgmout rst iab 4096 cycles 32 cycles 32 cycles $fffe $ffff
system integration module (sim) advance information mc68hc(7)08kh12 ? rev. 1.0 70 system integration module (sim) motorola 7.4.2.3 illegal opcode reset the sim decodes signals from the cpu to detect illegal instructions. an illegal instruction sets the ilop bit in the reset status register (rsr) and causes a reset. if the stop enable bit, stop, in the mask option register is logic zero, the sim treats the stop instruction as an illegal opcode and causes an illegal opcode reset. the sim actively pulls down the rst pin for all internal reset sources. 7.4.2.4 illegal address reset an opcode fetch from an unmapped address generates an illegal address reset. the sim verifies that the cpu is fetching an opcode prior to asserting the ilad bit in the reset status register (rsr) and resetting the mcu. a data fetch from an unmapped address does not generate a reset. the sim actively pulls down the rst pin for all internal reset sources. 7.4.2.5 universal serial bus reset the usb module will detect a reset signal on the bus by the presence of an extended se0 at the usb data pins of the upstream port. the reset signaling is specified to be present for a minimum of 10 ms. an active device (powered and not in the suspend state) seeing a single-ended zero on its usb data inputs for more than 2.5 m s may treat that signal as a reset, but must have interpreted the signaling as a reset within 5.5 m s. for usb device, an se0 condition between 4 and 8 low speed bit times or 32 and 64 high speed bit times represents a valid usb reset. after the reset is removed, the device will be in the attached, but not yet addressed or configured state (refer to section 9.1 of the usb specification). the device must be able to accept device address via a set_address command (refer to section 9.4 of the usb specification) no later than 10 ms after the reset is removed. reset can wake a device from the suspended mode. a device may take up to 10 ms to wake up from the suspended state.
system integration module (sim) sim counter mc68hc(7)08kh12 ? rev. 1.0 advance information motorola system integration module (sim) 71 7.5 sim counter the sim counter is used by the power-on reset module (por) and in stop mode recovery to allow the oscillator time to stabilize before enabling the internal bus (ibus) clocks. the sim counter also serves as a prescalar for the computer operating properly module (cop). the sim counter uses 12 stages for counting, followed by a 13th stage that triggers a reset of sim counters and supplies the clock for the cop module. the sim counter is clocked by the falling edge of cgmxclk. 7.5.1 sim counter during power-on reset the power-on reset module (por) detects power applied to the mcu. at power-on, the por circuit asserts the signal porrst. once the sim is initialized, it enables the oscillator to drive the bus clock state machine. 7.5.2 sim counter during stop mode recovery the sim counter also is used for stop mode recovery. the stop instruction clears the sim counter. after an interrupt, break, or reset, the sim senses the state of the short stop recovery bit, ssrec, in the mask option register. if the ssrec bit is a logic one, then the stop recovery is reduced from the normal delay of 4096 cgmxclk cycles down to 32 cgmxclk cycles. this is ideal for applications using canned oscillators that do not require long start-up times from stop mode. external crystal applications should use the full stop recovery time, that is, with ssrec cleared in the configuration register (config). 7.5.3 sim counter and reset states external reset has no effect on the sim counter. ( see 7.7.2 stop mode for details.) the sim counter is free-running after all reset states. ( see 7.4.2 active resets from internal sources for counter control and internal reset recovery sequences.)
system integration module (sim) advance information mc68hc(7)08kh12 ? rev. 1.0 72 system integration module (sim) motorola 7.6 exception control normal, sequential program execution can be changed in three different ways: interrupts maskable hardware cpu interrupts non-maskable software interrupt instruction (swi) reset break interrupts 7.6.1 interrupts an interrupt temporarily changes the sequence of program execution to respond to a particular event. figure 7-8 flow charts the handling of system interrupts. interrupts are latched, and arbitration is performed in the sim at the start of interrupt processing. the arbitration result is a constant that the cpu uses to determine which vector to fetch. once an interrupt is latched by the sim, no other interrupt can take precedence, regardless of priority, until the latched interrupt is serviced (or the i bit is cleared).
system integration module (sim) exception control mc68hc(7)08kh12 ? rev. 1.0 advance information motorola system integration module (sim) 73 figure 7-8. interrupt processing no no no yes no no yes no yes yes from reset break i bit set? irq1 interrupt? usb interrupt? fetch next instruction unstack cpu registers. stack cpu registers set i bit load pc with interrupt vector execute instruction. yes yes i bit set? interrupt? yes other interrupts? no swi instruciton? rti instruciton?
system integration module (sim) advance information mc68hc(7)08kh12 ? rev. 1.0 74 system integration module (sim) motorola at the beginning of an interrupt, the cpu saves the cpu register contents on the stack and sets the interrupt mask (i bit) to prevent additional interrupts. at the end of an interrupt, the rti instruction recovers the cpu register contents from the stack so that normal processing can resume. figure 7-9 shows interrupt entry timing. figure 7-10 shows interrupt recovery timing. figure 7-9 . interrupt entry figure 7-10. interrupt recovery 7.6.1.1 hardware interrupts a hardware interrupt does not stop the current instruction. processing of a hardware interrupt begins after completion of the current instruction. when the current instruction is complete, the sim checks all pending hardware interrupts. if interrupts are not masked (i bit clear in the condition code register), and if the corresponding interrupt enable bit is module idb r/w interrupt dummy sp sp ?1 sp ?2 sp ?3 sp ?4 vect h vect l start addr iab dummy pc ?1[7:0] pc ?1[15:8] x a ccr v data h v data l opcode i bit module idb r/w interrupt sp ?4 sp ?3 sp ?2 sp ?1 sp pc pc + 1 iab ccr a x pc ?1 [7:0] pc ?1 [15:8] opcode operand i bit
system integration module (sim) exception control mc68hc(7)08kh12 ? rev. 1.0 advance information motorola system integration module (sim) 75 set, the sim proceeds with interrupt processing; otherwise, the next instruction is fetched and executed. if more than one interrupt is pending at the end of an instruction execution, the highest priority interrupt is serviced first. figure 7-11 demonstrates what happens when two interrupts are pending. if an interrupt is pending upon exit from the original interrupt service routine, the pending interrupt is serviced before the lda instruction is executed. figure 7-11 . interrupt recognition example the lda opcode is prefetched by both the int1 and int2 rti instructions. however, in the case of the int1 rti prefetch, this is a redundant operation. note: to maintain compatibility with the m6805 family, the h register is not pushed on the stack during interrupt entry. if the interrupt service routine modifies the h register or uses the indexed addressing mode, software should save the h register and then restore it prior to exiting the routine. cli lda int1 pulh rti int2 background routine #$ff pshh int1 interrupt service routine pulh rti pshh int2 interrupt service routine
system integration module (sim) advance information mc68hc(7)08kh12 ? rev. 1.0 76 system integration module (sim) motorola 7.6.1.2 swi instruction the swi instruction is a non-maskable instruction that causes an interrupt regardless of the state of the interrupt mask (i bit) in the condition code register. note: a software interrupt pushes pc onto the stack. a software interrupt does not push pc ?1, as a hardware interrupt does. 7.6.2 interrupt status registers the flags in the interrupt status registers identify maskable interrupt sources. table 7-3 summarizes the interrupt sources and the interrupt status register flags that they set. the interrupt status registers can be useful for debugging. table 7-3. interrupt sources source flag mask (1) int register flag priority (2) vector address swi instruction 0 $fffc?fffd irq1 pin irqf1 imask1 if1 1 $fffa?fffb hub start of frame interrupt soff sofie if2 2 $fff8?fff9 hub 2nd end of frame point interrupt eof2f eof2ie hub end of packet interrupt eopf eopie hub bus signal transition detect interrupt tranf tranie hub endpoint0 transmit interrupt txdf txdie if3 3 $fff6?fff7 hub endpoint0 receive interrupt rxdf rxdie device endpoint 0 transmit interrupt txd0f txd0ie if4 4 $fff4?fff5 device endpoint 0 receive interrupt rxd0f rxd0ie usb endpoint1/2 transmit interrupt txd1f txd1ie tim channel 0 ch0f ch0ie if5 5 $fff2?fff3 tim channel 1 ch1f ch1ie if6 6 $fff0?fff1 tim over?w tof toie if7 7 $ffee?ffef port-e keyboard pin interrupt keyef imaske if8 8 $ffec?ffed
system integration module (sim) exception control mc68hc(7)08kh12 ? rev. 1.0 advance information motorola system integration module (sim) 77 7.6.2.1 interrupt status register 1 i f 6? f 1 ?interrupt flags 1? these flags indicate the presence of interrupt requests from the sources shown in table 7-3 . 1 = interrupt request present 0 = no interrupt request present bit 0 and bit 1 ?always read 0 port-d keyboard pin interrupt keydf imaskd if9 9 $ffea?ffeb port-f keyboard pin interrupt keyff imaskf if10 10 $ffe8?ffe9 phase-locked loop interrupt pllf pllie if11 11 $ffe6?ffe7 (1) the i bit in the condition code register is a global mask for all interrupts sources except the swi instruction. (2) 0= highest priority table 7-3. interrupt sources source flag mask (1) int register flag priority (2) vector address address: $fe04 bit 7 654321 bit 0 read: if6 if5 if4 if3 if2 if1 0 0 write: rrrrrrrr reset: 00000000 r = reserved figure 7-12. interrupt status register 1 (int1)
system integration module (sim) advance information mc68hc(7)08kh12 ? rev. 1.0 78 system integration module (sim) motorola 7.6.2.2 interrupt status register 2 i f 11? f 7 ?interrupt flags 11? these flags indicate the presence of interrupt requests from the sources shown in table 7-3 . 1 = interrupt request present 0 = no interrupt request present 7.6.2.3 interrupt status register 3 bits 7? ?always read 0 address: $fe05 bit 7 654321 bit 0 read: 0 0 0 if11 if10 if9 if8 if7 write: rrrrrrrr reset: 00000000 r = reserved figure 7-13. interrupt status register 2 (int2) address: $fe06 bit 7 654321 bit 0 read: 00000000 write: rrrrrrrr reset: 00000000 r = reserved figure 7-14. interrupt status register 2 (int2)
system integration module (sim) low-power modes mc68hc(7)08kh12 ? rev. 1.0 advance information motorola system integration module (sim) 79 7.6.3 reset all reset sources always have equal and highest priority and cannot be arbitrated. 7.6.4 break interrupts the break module can stop normal program flow at a software- programmable break point by asserting its break interrupt output. (see section 16. break module (break) .) the sim puts the cpu into the break state by forcing it to the swi vector location. refer to the break interrupt subsection of each module to see how each module is affected by the break state. 7.6.5 status flag protection in break mode the sim controls whether status flags contained in other modules can be cleared during break mode. the user can select whether flags are protected from being cleared by properly initializing the break clear flag enable bit (bcfe) in the break flag control register (bfcr). protecting flags in break mode ensures that set flags will not be cleared while in break mode. this protection allows registers to be freely read and written during break mode without losing status flag information. setting the bcfe bit enables the clearing mechanisms. once cleared in break mode, a flag remains cleared even when break mode is exited. status flags with a two-step clearing mechanism ?for example, a read of one register followed by the read or write of another ?are protected, even when the first step is accomplished prior to entering break mode. upon leaving break mode, execution of the second step will clear the flag as normal. 7.7 low-power modes executing the wait or stop instruction puts the mcu in a low-power- consumption mode for standby situations. the sim holds the cpu in a non-clocked state. the operation of each of these modes is described
system integration module (sim) advance information mc68hc(7)08kh12 ? rev. 1.0 80 system integration module (sim) motorola below. both stop and wait clear the interrupt mask (i) in the condition code register, allowing interrupts to occur. 7.7.1 wait mode in wait mode, the cpu clocks are inactive while the peripheral clocks continue to run. figure 7-15 shows the timing for wait mode entry. a module that is active during wait mode can wake up the cpu with an interrupt if the interrupt is enabled. stacking for the interrupt begins one cycle after the wait instruction during which the interrupt occurred. in wait mode, the cpu clocks are inactive. refer to the wait mode subsection of each module to see if the module is active or inactive in wait mode. some modules can be programmed to be active in wait mode. wait mode can also be exited by a reset or break. a break interrupt during wait mode sets the sim break stop/wait bit, sbsw, in the break status register (bsr). if the cop disable bit, copd, in the mask option register is logic zero, then the computer operating properly module (cop) is enabled and remains active in wait mode. figure 7-15. wait mode entry timing figure 7-16 and figure 7-17 show the timing for wait recovery. wait addr + 1 same same iab idb previous data next opcode same wait addr same r/w note: previous data can be operand data or the wait opcode, depending on the last instruction.
system integration module (sim) low-power modes mc68hc(7)08kh12 ? rev. 1.0 advance information motorola system integration module (sim) 81 figure 7-16. wait recovery from interrupt or break figure 7-17. wait recovery from internal reset 7.7.2 stop mode in stop mode, the sim counter is reset and the system clocks are disabled. an interrupt request from a module can cause an exit from stop mode. stacking for interrupts begins after the selected stop recovery time has elapsed. reset or break also causes an exit from stop mode. the sim disables the oscillator signals (cgmout and cgmxclk) in stop mode, stopping the cpu and peripherals. stop recovery time is selectable using the ssrec bit in the configuration register (config). if ssrec is set, stop recovery is reduced from the normal delay of 4096 cgmxclk cycles down to 32. this is ideal for applications using canned oscillators that do not require long startup times from stop mode. note: external crystal applications should use the full stop recovery time by clearing the ssrec bit. $6e0c $6e0b $00ff $00fe $00fd $00fc $a6 $a6 $01 $0b $6e $a6 iab idb exitstopwait note: exitstopwait = rst pin or cpu interrupt or break interrupt iab idb rst $a6 $a6 $6e0b rst v ct h rst v ct l $a6 cgmxclkcgmxclk 32 cycles 32 cycles
system integration module (sim) advance information mc68hc(7)08kh12 ? rev. 1.0 82 system integration module (sim) motorola a break interrupt during stop mode sets the sim break stop/wait bit (sbsw) in the break status register (bsr). the sim counter is held in reset from the execution of the stop instruction until the beginning of stop recovery. it is then used to time the recovery period. figure 7-18 shows stop mode entry timing. note: to minimize stop current, all pins configured as inputs should be driven to a logic 1 or logic 0. figure 7-18. stop mode entry timing figure 7-19. stop mode recovery from interrupt or break stop addr + 1 same same iab idb previous data next opcode same stop addr same r/w cpustop note: previous data can be operand data or the stop opcode, depending on the last instruction. cgmxclk int/break iab stop + 2 stop + 2 sp sp 1 sp 2 sp 3 stop +1 stop recovery period
system integration module (sim) sim registers mc68hc(7)08kh12 ? rev. 1.0 advance information motorola system integration module (sim) 83 7.8 sim registers the sim has three memory mapped registers. table 7-4 shows the mapping of these registers. 7.8.1 break status register (bsr) the break status register contains a flag to indicate that a break caused an exit from stop or wait mode. sbsw ?sim break stop/wait this status bit is useful in applications requiring a return to wait or stop mode after exiting from a break interrupt. clear sbsw by writing a logic zero to it. reset clears sbsw. 1 = stop mode or wait mode was exited by break interrupt 0 = stop mode or wait mode was not exited by break interrupt sbsw can be read within the break state swi routine. the user can modify the return address on the stack by subtracting one from it. the following code is an example of this. writing zero to the sbsw bit clears it. table 7-4. sim registers address register access mode $fe00 bsr user $fe01 rsr user $fe03 bfcr user address: $fe00 bit 7 654321 bit 0 read: rrrrrr sbsw r write: note 1 reset: 0 r = reserved 1. writing a logic zero clears sbsw figure 7-20. break status register (bsr)
system integration module (sim) advance information mc68hc(7)08kh12 ? rev. 1.0 84 system integration module (sim) motorola 7.8.2 reset status register (rsr) this register contains six flags that show the source of the last reset. clear the sim reset status register by reading it. a power-on reset sets the por bit and clears all other bits in the register. ; ; ; this code works if the h register has been pushed onto the stack in the break service routine software. this code should be executed at the end of the break service routine software. hibyte equ 5 lobyte equ 6 ; if not sbsw, do rti brclr sbsw,bsr, return ; ; see if wait mode or stop mode was exited by break tst lobyte,sp ; if returnlo is not zero, bne dolo ; then just decrement low byte. dec hibyte,sp ; else deal with high byte, too. dolo dec lobyte,sp ; point to wait/stop opcode. return pulh rti ; restore h register. address: $fe01 bit 7 654321 bit 0 read: por pin cop ilop ilad usb 0 0 write: por: 10000000 = unimplemented figure 7-21. reset status register (rsr)
system integration module (sim) sim registers mc68hc(7)08kh12 ? rev. 1.0 advance information motorola system integration module (sim) 85 por ?power-on reset bit 1 = last reset caused by por circuit 0 = read of rsr pin ?external reset bit 1 = last reset caused by external reset pin (rst ) 0 = por or read of rsr cop ?computer operating properly reset bit 1 = last reset caused by cop counter 0 = por or read of rsr ilop ?illegal opcode reset bit 1 = last reset caused by an illegal opcode 0 = por or read of rsr ilad ?illegal address reset bit (opcode fetches only) 1 = last reset caused by an opcode fetch from an illegal address 0 = por or read of rsr usb ?niversal serial bus reset bit 1 = last reset caused by an usb module 0 = por or read of rsr 7.8.3 break flag control register (bfcr) the break control register contains a bit that enables software to clear status bits while the mcu is in a break state. address: $fe03 bit 7 654321 bit 0 read: bcfe rrrrrrr write: reset: 00000000 r = reserved figure 7-22. break flag control register (bfcr)
system integration module (sim) advance information mc68hc(7)08kh12 ? rev. 1.0 86 system integration module (sim) motorola bcfe ?break clear flag enable bit this read/write bit enables software to clear status bits by accessing status registers while the mcu is in a break state. to clear status bits during the break state, the bcfe bit must be set. 1 = status bits clearable during break 0 = status bits not clearable during break
mc68hc(7)08kh12 ? rev. 1.0 advance information motorola clock generator module (cgm) 87 advance information ?mc68hc(7)08kh12 section 8. clock generator module (cgm) 8.1 contents 8.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 8.3 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 8.4 functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 8.4.1 crystal oscillator circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . 91 8.4.2 phase-locked loop circuit (pll) . . . . . . . . . . . . . . . . . . . . 91 8.4.3 pll circuits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91 8.4.4 acquisition and tracking modes . . . . . . . . . . . . . . . . . . . . . 93 8.4.5 manual and automatic pll bandwidth modes . . . . . . . . . . 93 8.4.6 programming the pll . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 8.4.7 special programming exceptions . . . . . . . . . . . . . . . . . . . . 95 8.4.8 base clock selector circuit. . . . . . . . . . . . . . . . . . . . . . . . . 96 8.4.9 cgm external connections. . . . . . . . . . . . . . . . . . . . . . . . . 96 8.5 i/o signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98 8.5.1 crystal amplifier input pin (osc1) . . . . . . . . . . . . . . . . . . . 98 8.5.2 crystal amplifier output pin (osc2) . . . . . . . . . . . . . . . . . . 98 8.5.3 external filter capacitor pin (cgmxfc). . . . . . . . . . . . . . . 98 8.5.4 pll analog power pin (v dda ) . . . . . . . . . . . . . . . . . . . . . . 98 8.5.5 pll analog ground pin (v ssa ) . . . . . . . . . . . . . . . . . . . . . . 98 8.5.6 buffered crystal clock output (cgmvout) . . . . . . . . . . . . 99 8.5.7 cgmvsel. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99 8.5.8 oscillator enable signal (simoscen) . . . . . . . . . . . . . . . . 99 8.5.9 crystal output frequency signal (cgmxclk) . . . . . . . . . . 99 8.5.10 cgm base clock output (cgmout) . . . . . . . . . . . . . . . . . 99 8.5.11 cgm cpu interrupt (cgmint) . . . . . . . . . . . . . . . . . . . . . . 99 8.6 cgm registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100 8.6.1 pll control register (pctl) . . . . . . . . . . . . . . . . . . . . . . 102 8.6.2 pll bandwidth control register (pbwc) . . . . . . . . . . . . . 104 8.6.3 pll multiplier select registers (pmsh:pmsl). . . . . . . . . 105
clock generator module (cgm) advance information mc68hc(7)08kh12 ? rev. 1.0 88 clock generator module (cgm) motorola 8.6.4 pll reference divider select register (prds) . . . . . . . . 106 8.7 interrupts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107 8.8 special modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107 8.8.1 wait mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107 8.8.2 cgm during break interrupts . . . . . . . . . . . . . . . . . . . . . . 108 8.9 acquisition/lock time specifications . . . . . . . . . . . . . . . . . . . 108 8.9.1 acquisition/lock time definitions . . . . . . . . . . . . . . . . . . . 108 8.9.2 parametric influences on reaction time . . . . . . . . . . . . . 109 8.9.3 choosing a filter capacitor. . . . . . . . . . . . . . . . . . . . . . . . 111 8.9.4 reaction time calculation . . . . . . . . . . . . . . . . . . . . . . . . 111 8.2 introduction this section describes the clock generator module (cgm). the cgm generates the crystal clock signal, cgmxclk, which operates at the frequency of the crystal. the cgm also generates the base clock signal, cgmout, which is based on either the crystal clock divided by two or the phase-locked loop (pll) clock, cgmpclk, divided by two. this is the clock from which the sim derives the system clocks, including the bus clock, which is at a frequency of cgmout/2. the pll also generates a cgmvclk clock, at 48mhz, for use as the usbclk. the pll is a fully functional frequency generator designed for use with crystals or ceramic resonators. this cgm is optimized to generate a 48mhz reference frequency for the usb module, from a 6mhz crystal.
clock generator module (cgm) features mc68hc(7)08kh12 ? rev. 1.0 advance information motorola clock generator module (cgm) 89 8.3 features features of the cgm include: vco center-of-range frequuency tuned to 48mhz for low-jitter clock reference for usb module low-frequency crystal operation with low-power operation and high-output frequency resolution programmable reference divider for even greater resolution programmable prescaler for power-of-two increases in bus frequency automatic bandwidth control mode for low-jitter operation automatic frequency lock detector cpu interrupt on entry or exit from locked condition 8.4 functional description the cgm consists of three major submodules: crystal oscillator circuit ?the crystal oscillator circuit generates the constant crystal frequency clock, cgmxclk. phase-locked loop (pll) ?the pll generates the programmable vco frequency clock, cgmvclk and cgmpclk. base clock selector circuit ?this software-controlled circuit selects either cgmxclk divided by two or the pll clock, cgmpclk, divided by two as the base clock, cgmout. the sim derives the system clocks from cgmout. figure 8-1 shows the structure of the cgm.
clock generator module (cgm) advance information mc68hc(7)08kh12 ? rev. 1.0 90 clock generator module (cgm) motorola figure 8-1. cgm block diagram bcs phase detector loop filter frequency divider voltage controlled oscillator automatic mode control lock detector clock cgmxclk cgmout cgmvdv cgmvclk simoscen interrupt control cgmint cgmrdv pll analog ? 2 cgmrclk osc2 osc1 select circuit v dda cgmxfc v ssa lock auto acq pllie pllf mul[11:0] reference divider rds[3:0] frequency divider pre[1:0] cgmpclk usbclk p n r clock select circuit phase-locked loop (pll) oscillator (osc) 48 mhz
clock generator module (cgm) functional description mc68hc(7)08kh12 ? rev. 1.0 advance information motorola clock generator module (cgm) 91 8.4.1 crystal oscillator circuit the crystal oscillator circuit consists of an inverting amplifier and an external crystal. the osc1 pin is the input to the amplifier and the osc2 pin is the output. the simoscen signal from the system integration module (sim) enables the crystal oscillator circuit. the cgmxclk signal is the output of the crystal oscillator circuit and runs at a rate equal to the crystal frequency. cgmxclk is then buffered to produce cgmrclk, the pll reference clock. cgmxclk can be used by other modules which require precise timing for operation. the duty cycle of cgmxclk is not guaranteed to be 50% and depends on external factors, including the crystal and related external components. an externally generated clock also can feed the osc1 pin of the crystal oscillator circuit. connect the external clock to the osc1 pin and let the osc2 pin float. 8.4.2 phase-locked loop circuit (pll) the pll is a frequency generator that can operate in either acquisition mode or tracking mode, depending on the accuracy of the output frequency. the pll can change between acquisition and tracking modes either automatically or manually. 8.4.3 pll circuits the pll consists of these circuits: voltage-controlled oscillator (vco) reference divider frequency prescaler modulo vco frequency divider phase detector loop filter lock detector
clock generator module (cgm) advance information mc68hc(7)08kh12 ? rev. 1.0 92 clock generator module (cgm) motorola the operating range of the vco is programmable for a wide range of frequencies and for maximum immunity to external noise, including supply and cgm/xfc noise. the vco frequency is bound to a range from roughly 40mhz to 56mhz, f vrs . modulating the voltage on the cgm/xfc pin changes the frequency within this range. by design, f vrs is tuned to a nominal center-of-range frequency of 48mhz. cgmrclk is the pll reference clock, a buffered version of cgmxclk. cgmrclk runs at a frequency, f rclk , and is fed to the pll through a programmable modulo reference divider, which divides f rclk by a factor r. this feature allows frequency steps of higher resolution. the divider? output is the final reference clock, cgmrdv, running at a frequency f rdv = f rclk /r. the vco? output clock, clk, running at a frequency f vclk is fed back through a programmable prescale divider and a programmable modulo divider. the prescaler divides the vco clock by a power-of-two factor p and the modulo divider reduces the vco clock by a factor, n. the dividers?output is the vco feedback clock, cgmvdv, running at a frequency f vdv = f vclk /(n 2 p ). (see 8.4.6 programming the pll for more information.) the phase detector then compares the vco feedback clock, cgmvdv, with the final reference clock, cgmrdv. a correction pulse is generated based on the phase difference between the two signals. the loop filter then slightly alters the dc voltage on the external capacitor connected to cgm/xfc based on the width and direction of the correction pulse. the filter can make fast or slow corrections depending on its mode, described in 8.4.4 acquisition and tracking modes . the value of the external capacitor and the reference frequency determines the speed of the corrections and the stability of the pll. the lock detector compares the frequencies of the vco feedback clock, cgmvdv, and the final reference clock, cgmrdv. therefore, the speed of the lock detector is directly proportional to the final reference frequency, f rdv . the circuit determines the mode of the pll and the lock condition based on this comparison.
clock generator module (cgm) functional description mc68hc(7)08kh12 ? rev. 1.0 advance information motorola clock generator module (cgm) 93 8.4.4 acquisition and tracking modes the pll filter is manually or automatically configurable into one of two operating modes: acquisition mode ?in acquisition mode, the filter can make large frequency corrections to the vco. this mode is used at pll startup or when the pll has suffered a severe noise hit and the vco frequency is far off the desired frequency. when in acquisition mode, the acq bit is clear in the pll bandwidth control register. (see 8.6.2 pll bandwidth control register (pbwc) .) tracking mode ?in tracking mode, the filter makes only small corrections to the frequency of the vco. pll jitter is much lower in tracking mode, but the response to noise is also slower. the pll enters tracking mode when the vco frequency is nearly correct, such as when the pll is selected as the base clock source. (see 8.4.8 base clock selector circuit .) the pll is automatically in tracking mode when not in acquisition mode or when the acq bit is set. 8.4.5 manual and automatic pll bandwidth modes this cgm is optimized for automatic pll bandwidth mode, and is the mode recommended for most users. in automatic bandwidth control mode (auto=1), the lock detector automatically switches between acquisition and tracking modes. automatic bandwidth control mode also is used to determine when the vco clock, cgmvclk, is safe to use as the source for the base clock, cgmout. (see 8.6.2 pll bandwidth control register (pbwc) .) if pll interrupts are enabled, the software can wait for a pll interrupt request and then check the lock bit. if interrupts are disabled, software can poll the lock bit continuously (during pll startup, usually) or at periodic intervals. in either case, when the lock bit is set, the vco clock is safe to use as the source for the base clock. (see 8.4.8 base clock selector circuit .) if the vco is selected as the source for the base clock and the lock bit is clear, the pll has suffered a severe
clock generator module (cgm) advance information mc68hc(7)08kh12 ? rev. 1.0 94 clock generator module (cgm) motorola noise hit and the software must take appropriate action, depending on the application. (see 8.7 interrupts for information and precautions on using interrupts.) the following conditions apply when the pll is in automatic bandwidth control mode: the acq bit (see 8.6.2 pll bandwidth control register (pbwc) .) is a read-only indicator of the mode of the filter. (see 8.4.4 acquisition and tracking modes .) the acq bit is set when the vco frequency is within a certain tolerance, d trk , and is cleared when the vco frequency is out of a certain tolerance, d unt . (see 8.9 acquisition/lock time specifications for more information.) the lock bit is a read-only indicator of the locked state of the pll. the lock bit is set when the vco frequency is within a certain tolerance, d lock , and is cleared when the vco frequency is out of a certain tolerance d unl . (see 8.9 acquisition/lock time specifications for more information.) cpu interrupts can occur if enabled (pllie = 1) when the pll? lock condition changes, toggling the lock bit. (see 8.6.1 pll control register (pctl) .) 8.4.6 programming the pll the following procedure shows how to program the pll. 1. choose the desired bus frequency, f bus . the relationship between the vco frequency f vclk and the bus frequency f bus is the vco frequency need to be at 48mhz for the usb module reference clock. choose p = 0, 1, 2, or 3 for a bus frequency of 12mhz, 6mhz, 3mhz, or 1.5mhz respectively. f vclk 2 p ------------- 4f bus = 48mhz 2 p ------------------- - 4f bus =
clock generator module (cgm) functional description mc68hc(7)08kh12 ? rev. 1.0 advance information motorola clock generator module (cgm) 95 2. choose a practical pll (crystal) reference frequency, f rclk , and the reference clock divider, r. frequency errors to the pll are corrected at a rate of f rclk /r. for stability and lock time reduction, this rate must be as fast as possible. the vco frequency must be an integer multiple of this rate. the relationship between the vco frequency f vclk and the reference frequency f rclk is choose the reference divider r = 1 for fast lock. choose a f rclk frequency with an integer divisor of f bus and solve for n. 3. program the pll registers accordingly: a. in the pre bits of the pll control register (pctl), program the binary equivalent of p. b. in the pll multiplier select register low (pmsl) and the pll multiplier select register high (pmsh), program the binary equivalent of n. c. in the pll reference divider select register (prds), program the binary coded equivalent of r. table 8-1 provides a numeric example (numbers are in hexadecimal notation): 8.4.7 special programming exceptions the programming method described in 8.4.6 programming the pll does not account for three possible exceptions. a value of zero for r, n, or l is meaningless when used in the equations given. to account for these exceptions: table 8-1. cgm numeric example f bus f rclk pnr 6mhz 6mhz 1 004 1 f vclk 2 p n r ---------------- - f rclk () = hence: 48mhz 2 p n r ---------------- - f rclk () =
clock generator module (cgm) advance information mc68hc(7)08kh12 ? rev. 1.0 96 clock generator module (cgm) motorola a zero value for r or n is interpreted exactly the same as a value of one. a zero value for l disables the pll and prevents its selection as the source for the base clock. (see 8.4.8 base clock selector circuit .) 8.4.8 base clock selector circuit this circuit is used to select either the crystal clock, cgmxclk, or the pll clock, cgmpclk, as the source of the base clock, cgmout. the two input clocks go through a transition control circuit that waits up to three cgmxclk cycles and three cgmpclk cycles to change from one clock source to the other. during this time, cgmout is held in stasis. the output of the transition control circuit is then divided by two to correct the duty cycle. therefore, the bus clock frequency, which is one-half of the base clock frequency, is one-fourth the frequency of the selected clock (cgmxclk or cgmpclk). the bcs bit in the pll control register (pctl) selects which clock drives cgmout. the vco clock cannot be selected as the base clock source if the pll is not turned on. the pll cannot be turned off if the vco clock is selected. the pll cannot be turned on or off simultaneously with the selection or deselection of the vco clock. this circuit is also used to select either the crystal clock, cgmxclk or the vco clock, cgmvclk, as the source of the usb clock, usbclk. 8.4.9 cgm external connections in its typical configuration, the cgm requires seven external components. five of these are for the crystal oscillator and two are for the pll. the crystal oscillator is normally connected in a pierce oscillator configuration, as shown in figure 8-2 . figure 8-2 shows only the logical representation of the internal components and may not represent actual circuitry. the oscillator configuration uses five components: crystal, x 1 fixed capacitor, c 1
clock generator module (cgm) functional description mc68hc(7)08kh12 ? rev. 1.0 advance information motorola clock generator module (cgm) 97 tuning capacitor, c 2 (can also be a fixed capacitor) feedback resistor, r b series resistor, r s (optional) the series resistor (r s ) is included in the diagram to follow strict pierce oscillator guidelines and may not be required for all ranges of operation, especially with high frequency crystals. refer to the crystal manufacturer? data for more information. figure 8-2 also shows the external components for the pll: bypass capacitor, c byp filter capacitor, c f routing should be done with great care to minimize signal cross talk and noise. see section 17. preliminary electrical specifications for capacitor and resistor values. figure 8-2. cgm external connections simoscen cgmxclk r b x 1 *r s can be zero (shorted) when used with higher-frequency crystals. refer to manufacturer? data. osc1 osc2 v ssa cgmxfc v dda v dd c byp r s * c 1 c 2 c f
clock generator module (cgm) advance information mc68hc(7)08kh12 ? rev. 1.0 98 clock generator module (cgm) motorola 8.5 i/o signals the following paragraphs describe the cgm i/o signals. 8.5.1 crystal amplifier input pin (osc1) the osc1 pin is an input to the crystal oscillator amplifier. 8.5.2 crystal amplifier output pin (osc2) the osc2 pin is the output of the crystal oscillator inverting amplifier. 8.5.3 external filter capacitor pin (cgmxfc) the cgmxfc pin is required by the loop filter to filter out phase corrections. a small external capacitor is connected to this pin. note: to prevent noise problems, c f should be placed as close to the cgmxfc pin as possible, with minimum routing distances and no routing of other signals across the c f connection. 8.5.4 pll analog power pin (v dda ) v dda is a power pin used by the analog portions of the pll. connect the v dda pin to the same voltage potential as the v dd pin. note: route v dda carefully for maximum noise immunity and place bypass capacitors as close as possible to the package. 8.5.5 pll analog ground pin (v ssa ) v ssa is a ground pin used by the analog portions of the pll. connect the v ssa pin to the same voltage potential as the v ss pin. note: route v ssa carefully for maximum noise immunity and place bypass capacitors as close as possible to the package.
clock generator module (cgm) i/o signals mc68hc(7)08kh12 ? rev. 1.0 advance information motorola clock generator module (cgm) 99 8.5.6 buffered crystal clock output (cgmvout) cgmvout buffers the osc1 clock for external use. 8.5.7 cgmvsel cgmvsel must be tied low or floated. 8.5.8 oscillator enable signal (simoscen) the simoscen signal comes from the system integration module (sim) and enables the oscillator and pll. 8.5.9 crystal output frequency signal (cgmxclk) cgmxclk is the crystal oscillator output signal. it runs at the full speed of the crystal (f xclk ) and comes directly from the crystal oscillator circuit. figure 8-2 shows only the logical relation of cgmxclk to osc1 and osc2 and may not represent the actual circuitry. the duty cycle of cgmxclk is unknown and may depend on the crystal and other external factors. also, the frequency and amplitude of cgmxclk can be unstable at startup. 8.5.10 cgm base clock output (cgmout) cgmout is the clock output of the cgm. this signal goes to the sim, which generates the mcu clocks. cgmout is a 50 percent duty cycle clock running at twice the bus frequency. cgmout is software programmable to be either the oscillator output, cgmxclk, divided by two or the vco clock, cgmvclk, divided by two. 8.5.11 cgm cpu interrupt (cgmint) cgmint is the interrupt signal generated by the pll lock detector.
clock generator module (cgm) advance information mc68hc(7)08kh12 ? rev. 1.0 100 clock generator module (cgm) motorola 8.6 cgm registers these registers control and monitor operation of the cgm: pll control register (pctl) (see 8.6.1 pll control register (pctl) .) pll bandwidth control register (pbwc) (see 8.6.2 pll bandwidth control register (pbwc) .) pll multiplier select registers (pmsh:pmsl) (see 8.6.3 pll multiplier select registers (pmsh:pmsl) .) pll reference divider select register (prds) (see 8.6.4 pll reference divider select register (prds) .) table 8-2 is a summary of the cgm registers.
clock generator module (cgm) cgm registers mc68hc(7)08kh12 ? rev. 1.0 advance information motorola clock generator module (cgm) 101 table 8-2. cgm i/o register summary addr. register name bit 7 654321 bit 0 $003a pll control register (pctl) read: pllie pllf pllon bcs pre1 pre2 00 write: reset: 00101000 $003b pll bandwidth control register (pbwc) read: auto lock a cq 00000 write: reset: 00000000 $003c pll multiplier select register high (pmsh) read: 0000 mul11 mul10 mul9 mul8 write: reset: 00000000 $003d pll multiplier select register low (pmsl) read: mul7 mul6 mul5 mul4 mul3 mul2 mul1 mul0 write: reset: 00000010 $003e unimplemented read: write: reset: $003f pll reference divider select register (prds) read: 0000 rds3 rds2 rds1 rds0 write: reset: 00000001 = unimplemented notes: 1. when auto = 0, pllie is forced clear and is read-only. 2. when auto = 0, pllf and lock read as clear. 3. when auto = 1, acq is read-only. 4. when pllon = 0 or vrs7:vrs0 = $0, bcs is forced clear and is read-only. 5. when pllon = 1, the pll programming register is read-only. 6. when bcs = 1, pllon is forced set and is read-only.
clock generator module (cgm) advance information mc68hc(7)08kh12 ? rev. 1.0 102 clock generator module (cgm) motorola 8.6.1 pll control register (pctl) the pll control register contains the interrupt enable and flag bits, the on/off switch, the base clock selector bit, the prescaler bits, and the vco power of two range selector bits. pllie ?pll interrupt enable bit this read/write bit enables the pll to generate an interrupt request when the lock bit toggles, setting the pll flag, pllf. when the auto bit in the pll bandwidth control register (pbwc) is clear, pllie cannot be written and reads as logic zero. reset clears the pllie bit. 1 = pll interrupts enabled 0 = pll interrupts disabled pllf ?pll interrupt flag bit this read-only bit is set whenever the lock bit toggles. pllf generates an interrupt request if the pllie bit also is set. pllf always reads as logic zero when the auto bit in the pll bandwidth control register (pbwc) is clear. clear the pllf bit by reading the pll control register. reset clears the pllf bit. 1 = change in lock condition 0 = no change in lock condition note: do not inadvertently clear the pllf bit. any read or read-modify-write operation on the pll control register clears the pllf bit. address: $003a bit 7 654321 bit 0 read: pllie pllf pllon bcs pre1 pre2 00 write: reset: 00101000 = unimplemented figure 8-3. pll control register (pctl)
clock generator module (cgm) cgm registers mc68hc(7)08kh12 ? rev. 1.0 advance information motorola clock generator module (cgm) 103 pllon ?pll on bit this read/write bit activates the pll and enables the vco clock, cgmvclk. pllon cannot be cleared if the vco clock is driving the base clock, cgmout (bcs = 1). (see 8.4.8 base clock selector circuit .) reset sets this bit so that the loop can stabilize as the mcu is powering up. 1 = pll on 0 = pll off bcs ?base clock select bit this read/write bit selects either the crystal oscillator clock (cgmxclk) or the vco clocks (cgmpclk and cgmvclk) to use as base clocks for the mcu. bcs cannot be set while the pllon bit is clear. after toggling bcs, it may take up to three cgmxclk and three cgmpclk cycles to complete the transition from one source clock to the other. during the transition, cgmout is held in stasis. (see 8.4.8 base clock selector circuit .) reset clears the bcs bit. 1 = selects the vco clocks for the base clock. cgmpclk divided by two drives cgmout, cgmvclk (48mhz) drives usbclk 0 = selects the crystal oscillator clock for the base clock. cgmxclk divided by two drives cgmout, cgmxclk drives usbclk note: pllon and bcs have built-in protection that prevents the base clock selector circuit from selecting the vco clock as the source of the base clock if the pll is off. therefore, pllon cannot be cleared when bcs is set, and bcs cannot be set when pllon is clear. if the pll is off (pllon = 0), selecting cgmpclk/cgmvclk requires two writes to the pll control register. (see 8.4.8 base clock selector circuit .) pre1 and pre0 ?prescaler program bits these read/write bits control a prescaler that selects the prescaler power-of-two multiplier p. (see 8.4.3 pll circuits and 8.4.6 programming the pll .) pre1:pre0 cannot be written when the pllon bit is set. reset clears these bits.
clock generator module (cgm) advance information mc68hc(7)08kh12 ? rev. 1.0 104 clock generator module (cgm) motorola 8.6.2 pll bandwidth control register (pbwc) the pll bandwidth control register: indicates when the pll is locked in automatic bandwidth control mode, indicates when the pll is in acquisition or tracking mode auto ?automatic bandwidth control bit this read/write bit selects automatic or manual bandwidth control. since this cgm is optimized a frequency output of 48mhz for the usb module, automatic control should be set. reset clears the auto bit. 1 = automatic bandwidth control (recommended) 0 = manual bandwidth control lock ?lock indicator bit when the auto bit is set, lock is a read-only bit that becomes set when the vco clock, cgmvclk, is locked (running at the programmed frequency). when the auto bit is clear, lock reads as table 8-3. pre[1:0] programming pre1 pre0 p prescaler multiplier 000 1 011 2 102 4 113 8 address: $003b bit 7 654321 bit 0 read: auto lock a cq 00000 write: reset: 00000000 = unimplemented figure 8-4. pll bandwidth control register (pbwc)
clock generator module (cgm) cgm registers mc68hc(7)08kh12 ? rev. 1.0 advance information motorola clock generator module (cgm) 105 logic zero and has no meaning. the write one function of this bit is reserved for test, so this bit must always be written a zero. reset clears the lock bit. 1 = vco frequency correct or locked 0 = vco frequency incorrect or unlocked acq ?acquisition mode bit when the auto bit is set, acq is a read-only bit that indicates whether the pll is in acquisition mode or tracking mode. when the auto bit is clear, acq is a read/write bit that controls whether the pll is in acquisition or tracking mode. in automatic bandwidth control mode (auto = 1), the last-written value from manual operation is stored in a temporary location and is recovered when manual operation resumes. reset clears this bit, enabling acquisition mode. 1 = tracking mode 0 = acquisition mode 8.6.3 pll multiplier select registers (pmsh:pmsl) the pll multiplier select registers contain the programming information for the modulo feedback divider. address: $003c pmsh bit 7 654321 bit 0 read: 0000 mul11 mul10 mul9 mul8 write: reset: 00000000 address: $003d pmsl read: mul7 mul6 mul5 mul4 mul3 mul2 mul1 mul0 write: reset: 00000010 = unimplemented figure 8-5. pll multiplier select registers (pmsh:pmsl)
clock generator module (cgm) advance information mc68hc(7)08kh12 ? rev. 1.0 106 clock generator module (cgm) motorola mul[11:0] ?multiplier select bits these read/write bits control the modulo feedback divider that selects the vco frequency multiplier n. (see 8.4.3 pll circuits and 8.4.6 programming the pll .) mul[11:0] cannot be written when the pllon bit in the pctl is set. a value of $0000 in the multiplier select registers configures the modulo feedback divider the same as a value of $0001. reset initializes the registers to $002 for a default multiply value of 2. note: the multiplier select bits have built-in protection such that they cannot be written when the pll is on (pllon = 1). 8.6.4 pll reference divider select register (prds) the pll reference divider select register contains the programming information for the modulo reference divider. rds[3:0] ?reference divider select bits these read/write bits control the modulo reference divider that selects the reference division factor r. (see 8.4.3 pll circuits and 8.4.6 programming the pll .) rds[7:0] cannot be written when the pllon bit in the pctl is set. a value of $00 in the reference divider select register configures the reference divider the same as a value of $01. (see 8.4.7 special programming exceptions .) reset initializes the register to $01 for a default divide value of 1. note: the reference divider select bits have built-in protection such that they cannot be written when the pll is on (pllon = 1). address: $003f bit 7 654321 bit 0 read: 0000 rds3 rds2 rds1 rds0 write: reset: 00000001 = unimplemented figure 8-6. pll reference divider select register (prds)
clock generator module (cgm) interrupts mc68hc(7)08kh12 ? rev. 1.0 advance information motorola clock generator module (cgm) 107 8.7 interrupts when the auto bit is set in the pll bandwidth control register (pbwc), the pll can generate a cpu interrupt request every time the lock bit changes state. the pllie bit in the pll control register (pctl) enables cpu interrupts from the pll. pllf, the interrupt flag in the pctl, becomes set whether interrupts are enabled or not. when the auto bit is clear, cpu interrupts from the pll are disabled and pllf reads as logic zero. software should read the lock bit after a pll interrupt request to see if the request was due to an entry into lock or an exit from lock. when the pll enters lock, the vco clock, cgmpclk, divided by two can be selected as the cgmout source by setting bcs in the pctl. when the pll exits lock, the vco clock frequency is corrupt, and appropriate precautions should be taken. if the application is not frequency sensitive, interrupts should be disabled to prevent pll interrupt service routines from impeding software performance or from exceeding stack limitations. note: software can select the cgmpclk divided by two as the cgmout source even if the pll is not locked (lock = 0). therefore, software should make sure the pll is locked before setting the bcs bit. 8.8 special modes the wait instruction puts the mcu in low-power-consumption standby modes. 8.8.1 wait mode the wait instruction does not affect the cgm. before entering wait mode, software can disengage and turn off the pll by clearing the bcs and pllon bits in the pll control register (pctl) to save power. less power-sensitive applications can disengage the pll without turning it off, so that the pll clock is immediately available at wait exit. this would also be the case when the pll is to wake the mcu from wait mode, such as when the pll is first enabled and waiting for lock, or lock is lost.
clock generator module (cgm) advance information mc68hc(7)08kh12 ? rev. 1.0 108 clock generator module (cgm) motorola 8.8.2 cgm during break interrupts the system integration module (sim) controls whether status bits in other modules can be cleared during the break state. the bcfe bit in the sim break flag control register (sbfcr) enables software to clear status bits during the break state. (see 7.8.3 break flag control register (bfcr) .) to allow software to clear status bits during a break interrupt, write a logic one to the bcfe bit. if a status bit is cleared during the break state, it remains cleared when the mcu exits the break state. to protect the pllf bit during the break state, write a logic zero to the bcfe bit. with bcfe at logic zero (its default state), software can read and write the pll control register during the break state without affecting the pllf bit. 8.9 acquisition/lock time specifications the acquisition and lock times of the pll are, in many applications, the most critical pll design parameters. proper design and use of the pll ensures the highest stability and lowest acquisition/lock times. 8.9.1 acquisition/lock time definitions typical control systems refer to the acquisition time or lock time as the reaction time, within specified tolerances, of the system to a step input. in a pll, the step input occurs when the pll is turned on or when it suffers a noise hit. the tolerance is usually specified as a percent of the step input or when the output settles to the desired value plus or minus a percent of the frequency change. therefore, the reaction time is constant in this definition, regardless of the size of the step input. for example, consider a system with a 5 percent acquisition time tolerance. if a command instructs the system to change from 0 hz to 1 mhz, the acquisition time is the time taken for the frequency to reach 1 mhz 50 khz. fifty khz = 5% of the 1 mhz step input. if the system is operating at 1 mhz and suffers a ?00 khz noise hit, the acquisition time is the time taken to return from 900 khz to 1 mhz 5 khz. five khz = 5 percent of the 100-khz step input.
clock generator module (cgm) acquisition/lock time specifications mc68hc(7)08kh12 ? rev. 1.0 advance information motorola clock generator module (cgm) 109 other systems refer to acquisition and lock times as the time the system takes to reduce the error between the actual output and the desired output to within specified tolerances. therefore, the acquisition or lock time varies according to the original error in the output. minor errors may not even be registered. typical pll applications prefer to use this definition because the system requires the output frequency to be within a certain tolerance of the desired frequency regardless of the size of the initial error. the discrepancy in these definitions makes it difficult to specify an acquisition or lock time for a typical pll. therefore, the definitions for acquisition and lock times for this module are: acquisition time, t acq , is the time the pll takes to reduce the error between the actual output frequency and the desired output frequency to less than the tracking mode entry tolerance, d trk . acquisition time is based on an initial frequency error, (f des ?f orig )/f des , of not more than 100 percent. in automatic bandwidth control mode (see 8.4.5 manual and automatic pll bandwidth modes .), acquisition time expires when the acq bit becomes set in the pll bandwidth control register (pbwc). lock time, t lock , is the time the pll takes to reduce the error between the actual output frequency and the desired output frequency to less than the lock mode entry tolerance, d lock . lock time is based on an initial frequency error, (f des ?f orig )/f des , of not more than 100 percent. in automatic bandwidth control mode, lock time expires when the lock bit becomes set in the pll bandwidth control register (pbwc). (see 8.4.5 manual and automatic pll bandwidth modes .) obviously, the acquisition and lock times can vary according to how large the frequency error is and may be shorter or longer in many cases. 8.9.2 parametric influences on reaction time acquisition and lock times are designed to be as short as possible while still providing the highest possible stability. these reaction times are not constant, however. many factors directly and indirectly affect the acquisition time.
clock generator module (cgm) advance information mc68hc(7)08kh12 ? rev. 1.0 110 clock generator module (cgm) motorola the most critical parameter which affects the reaction times of the pll is the reference frequency, f rdv . this frequency is the input to the phase detector and controls how often the pll makes corrections. for stability, the corrections must be small compared to the desired frequency, so several corrections are required to reduce the frequency error. therefore, the slower the reference the longer it takes to make these corrections. this parameter is under user control via the choice of crystal frequency f xclk and the r value programmed in the reference divider. (see 8.4.3 pll circuits , 8.4.6 programming the pll , and 8.6.4 pll reference divider select register (prds) .) another critical parameter is the external filter capacitor. the pll modifies the voltage on the vco by adding or subtracting charge from this capacitor. therefore, the rate at which the voltage changes for a given frequency error (thus change in charge) is proportional to the capacitor size. the size of the capacitor also is related to the stability of the pll. if the capacitor is too small, the pll cannot make small enough adjustments to the voltage and the system cannot lock. if the capacitor is too large, the pll may not be able to adjust the voltage in a reasonable time. (see 8.9.3 choosing a filter capacitor .) also important is the operating voltage potential applied to v dda . the power supply potential alters the characteristics of the pll. a fixed value is best. variable supplies, such as batteries, are acceptable if they vary within a known range at very slow speeds. noise on the power supply is not acceptable, because it causes small frequency errors which continually change the acquisition time of the pll. temperature and processing also can affect acquisition time because the electrical characteristics of the pll change. the part operates as specified as long as these influences stay within the specified limits. external factors, however, can cause drastic changes in the operation of the pll. these factors include noise injected into the pll through the filter capacitor, filter capacitor leakage, stray impedances on the circuit board, and even humidity or circuit board contamination.
clock generator module (cgm) acquisition/lock time specifications mc68hc(7)08kh12 ? rev. 1.0 advance information motorola clock generator module (cgm) 111 8.9.3 choosing a filter capacitor as described in 8.9.2 parametric influences on reaction time , the external filter capacitor, c f , is critical to the stability and reaction time of the pll. the pll is also dependent on reference frequency and supply voltage. the value of the capacitor must, therefore, be chosen with supply potential and reference frequency in mind. for proper operation, the external filter capacitor must be chosen according to this equation: for the value of v dda , choose the voltage potential at which the mcu is operating. if the power supply is variable, choose a value near the middle of the range of possible supply values. this equation does not always yield a commonly available capacitor size, so round to the nearest available size. if the value is between two different sizes, choose the higher value for better stability. choosing the lower size may seem attractive for acquisition time improvement, but the pll may become unstable. also, always choose a capacitor with a tight tolerance ( 20 percent or better) and low dissipation. 8.9.4 reaction time calculation the actual acquisition and lock times can be calculated using the equations below. these equations yield nominal values under the following conditions: correct selection of filter capacitor, c f (see 8.9.3 choosing a filter capacitor .) room temperature operation negligible external leakage on cgmxfc negligible noise the k factor in the equations is derived from internal pll parameters. k acq is the k factor when the pll is configured in acquisition mode, and k trk is the k factor when the pll is configured in tracking mode. (see 8.4.4 acquisition and tracking modes .) reaction time is based on c f c fact v dda f rdv ------------ - ? ?? =
clock generator module (cgm) advance information mc68hc(7)08kh12 ? rev. 1.0 112 clock generator module (cgm) motorola an initial frequency error, (f des ?f orig )/f des , of not more than 100 percent. note: the inverse proportionality between the lock time and the reference frequency. in automatic bandwidth control mode, the acquisition and lock times are quantized into units based on the reference frequency. (see 8.4.5 manual and automatic pll bandwidth modes .) a certain number of clock cycles, n acq , is required to ascertain that the pll is within the tracking mode entry tolerance, d trk , before exiting acquisition mode. a certain number of clock cycles, n trk , is required to ascertain that the pll is within the lock mode entry tolerance, d lock . therefore, the acquisition time, t acq , is an integer multiple of n acq /f rdv , and the acquisition to lock time, t al , is an integer multiple of n trk /f rdv . in manual mode, it is usually necessary to wait considerably longer than t lockmax before selecting the pll clock (see 8.4.8 base clock selector circuit .), because the factors described in 8.9.2 parametric influences on reaction time may slow the lock time considerably. automatic bandwidth mode is recommended for most users. t acq v dda f rdv ------------ - ? ?? 8 k acq ------------ - ? ?? = t al v dda f rdv ------------ - ? ?? 4 k trk ------------ ? ?? = t lockmax t acq t al 256t vrdv ++ =
mc68hc(7)08kh12 ? rev. 1.0 advance information motorola universal serial bus module (usb) 113 advance information ?mc68hc(7)08kh12 section 9. universal serial bus module (usb) 9.1 contents 9.2 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114 9.3 overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115 9.4 i/o register description of the hub function . . . . . . . . . . . . . 116 9.4.1 usb hub root port control register (hrpcr) . . . . . . . . 120 9.4.2 usb hub downstream port control register (hdp1cr-hdp4cr) . . . . . . . . . . . . . . . . . . . . . . . . . . 121 9.4.3 usb sie timing interrupt register (sietir). . . . . . . . . . . 123 9.4.4 usb sie timing status register (sietsr) . . . . . . . . . . . 125 9.4.5 usb hub address register (haddr) . . . . . . . . . . . . . . . 127 9.4.6 usb hub interrupt register 0 (hir0) . . . . . . . . . . . . . . . . 128 9.4.7 usb hub control register 0 (hcr0) . . . . . . . . . . . . . . . . 129 9.4.8 usb hub endpoint1 control & data register (hcdr) . . 131 9.4.9 usb hub status register (hsr) . . . . . . . . . . . . . . . . . . . 132 9.4.10 usb hub endpoint 0 data registers 0-7 (he0d0-he0d7). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134 9.5 i/o register description of the embedded device function . 134 9.5.1 usb embedded device address register (daddr) . . . . 138 9.5.2 usb embedded device interrupt register 0 (dir0) . . . . . 138 9.5.3 usb embedded device interrupt register 1 (dir1) . . . . . 140 9.5.4 usb embedded device control register 0 (dcr0) . . . . . 141 9.5.5 usb embedded device control register 1 (dcr1) . . . . . 143 9.5.6 usb embedded device status register (dsr) . . . . . . . . 144 9.5.7 usb embedded device control register 2 (dcr2) . . . . . 146 9.5.8 usb embedded device endpoint 0 data registers (de0d0-de0d7). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147 9.5.9 usb embedded device endpoint 1/2 data registers (de1d0-de1d7). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
universal serial bus module (usb) advance information mc68hc(7)08kh12 ? rev. 1.0 114 universal serial bus module (usb) motorola 9.2 features features of the general usb module include the following: integrated 3.3 volt regulator with 3.3v output pin regout integrated usb transceiver supporting both full speed and low speed functions usb data control logic packet decoding/generation crc generation and checking nrzi encoding/decoding bit stuffing/de-stuffing usb reset support suspend and resume operations remote wakeup support stall, nak, and ack handshake generation features of the hub function include the following: hub control endpoint 0 8-byte transmit buffer 8-byte receive buffer hub interrupt endpoint 1 1-byte transmit buffer usb interrupts transaction interrupt driven start of frame interrupt eof2 interrupt end of packet interrupt signal transition interrupt frame timer locked interrupt hub repeater and controller function downstream and upstream connectivity bus state evaluation selective reset, suspend and resume fault condition hardware detection
universal serial bus module (usb) overview mc68hc(7)08kh12 ? rev. 1.0 advance information motorola universal serial bus module (usb) 115 features of the embedded device function include the following: device control endpoint 0 and interrupt endpoints 1 and 2 8-byte transmit buffer 8-byte receive buffer device interrupt endpoints 1 and 2 8-byte transmit buffer usb generated interrupts transaction interrupt driven 9.3 overview this section provides an overview of the universal serial bus (usb) module developed for the mc68hc(7)08kh12. this usb module is designed to serve as a compound device, and operates from a reference frequency of 48mhz, derived from the cgm (see section 8. clock generator module (cgm) ). an embedded full speed device function is combined with a hub in a single usb module. for the hub sub-module, ?e basic properties can be supported by the hardware or the software: connectivity behavior, power management, device connect/disconnect detection, bus fault detection and recovery, and full/low speed device traf? control. endpoint 0 of the hub sub-module functions as a receive/transmit control endpoint. endpoint 1 of the hub sub-module functions as interrupt transfer to report the device change state. for the embedded device sub-module, three types of usb data transfers are supported: control, interrupt, and bulk (transmit only). endpoint 0 of the embedded device sub-module functions as a receive/transmit control endpoint. endpoints 1 and 2 of the embedded device sub-module can function as interrupt or bulk, but only in the transmit direction. a block diagram of the usb module is shown figure 9-1 . the usb module manages communications between the host and the usb function. the module is partitioned into eight functional blocks. these blocks consist of a 3.3 volt regulator, a dual function transceiver, the hub repeater function, the sie (serial interface engine), the frame counter logic, the hub control logic, the embedded device control logic, and the endpoint registers.
universal serial bus module (usb) advance information mc68hc(7)08kh12 ? rev. 1.0 116 universal serial bus module (usb) motorola figure 9-1. usb block diagram 9.4 i/o register description of the hub function the usb hub function provides a set of control/status registers and sixteen data registers that provide storage for the buffering of data between the usb hub function and the cpu. these registers are shown in table 9-1 and table 9-2 . d0+ d0 transceiver 3.3 v out cpu bus transceiver d1+ : d4+ d1 : d4 roor port downstream ports hub repeater regulator serial frame counter engine hub control logic registers endpoint 0 - 8/8 b (control) endpoint 1 - 1 b (interrupt) endpoint 0 - 8/8 (control) endpoint 1/2 - 8 b (transmit only, interrupt/bulk) 12 mhz usbclk (from cgm) embedded device control logic interface 48 mhz
universal serial bus module (usb) i/o register description of the hub function mc68hc(7)08kh12 ? rev. 1.0 advance information motorola universal serial bus module (usb) 117 table 9-1. hub control register summary addr. register name bit 7 654321 bit 0 $0051 usb hub downstream port 1 control register (hdp1cr) read: pen1 lowsp1 rst1 resum1 susp1 0 d1+ d1 write: reset: 000000xx $0052 usb hub downstream port 2 control register (hdp2cr) read: pen2 lowsp2 rst2 resum2 susp2 0 d2+ d2 write: reset: 000000xx $0053 usb hub downstream port 3 control register (hdp3cr) read: pen3 lowsp3 rst3 resum3 susp3 0 d3+ d3 write: reset: 000000xx $0054 usb hub downstream port 4 control register (hdp4cr) read: pen4 lowsp4 rst4 resum4 susp4 0 d4+ d4 write: reset: 000000xx $0055 unimplemented read: write: reset: $0056 usb sie timing interrupt register (sietir) read: soff eof2f eopf tranf sofie eof2ie eopie tranie write: reset: 00000000 $0057 usb sie timing status register (sietsr) read: rstf 0 lockf 00000 write: rstfr lockfr soffr eof2fr eopfr tranfr reset: 0** 0000000 $0058 usb hub address register (haddr) read: usben add6 add5 add4 add3 add2 add1 add0 write: reset: 0** 0000000 $0059 usb hub interrupt register 0 (hir0) read: txdf rxdf 0 0 txdie rxdie 00 write: txdfr rxdfr reset: 00000000
universal serial bus module (usb) advance information mc68hc(7)08kh12 ? rev. 1.0 118 universal serial bus module (usb) motorola $005a unimplemented read: write: reset: $005b usb hub control register 0 (hcr0) read: tseq stall0 txe rxe tpsiz3 tpsiz2 tpsiz1 tpsiz0 write: reset: 00000000 $005c usb hub endpoint 1 control and data register (hcdr) read: stall1 pnew pchg5 pchg4 pchg3 pchg2 pchg1 pchg0 write: reset: 00000000 $005d usb hub status register (hsr) read: rseq setup tx1st 0 rpsiz3 rpsiz2 rpsiz1 rpsiz0 write: tx1str reset: x x 0 0 xxxx $005e usb hub root port control register (hrpcr) read: 0 0 0 resum0 suspnd 0 d0+ d0 write: reset: 000000xx = unimplemented x = indeterminate 0** = reset by por only
universal serial bus module (usb) i/o register description of the hub function mc68hc(7)08kh12 ? rev. 1.0 advance information motorola universal serial bus module (usb) 119 table 9-2. hub data register summary addr. register name bit 7 654321 bit 0 $0030 usb hub endpoint 0 data register 0 (he0d0) read: he0r07 he0r06 he0r05 he0r04 he0r03 he0r02 he0r01 he0r00 write: he0t07 he0t06 he0t05 he0t04 he0t03 he0t02 he0t01 he0t00 reset: xxxxxxxx $0031 usb hub endpoint 0 data register 1 (he0d1) read: he0r17 he0r16 he0r15 he0r14 he0r13 he0r12 he0r11 he0r10 write: he0t17 he0t16 he0t15 he0t14 he0t13 he0t12 he0t11 he0t10 reset: xxxxxxxx $0032 usb hub endpoint 0 data register 2 (he0d2) read: he0r27 he0r26 he0r25 he0r24 he0r23 he0r22 he0r21 he0r20 write: he0t27 he0t26 he0t25 he0t24 he0t23 he0t22 he0t21 he0t20 reset: xxxxxxxx $0033 usb hub endpoint 0 data register 3 (he0d3) read: he0r37 he0r36 he0r35 he0r34 he0r33 he0r32 he0r31 he0r30 write: he0t37 he0t36 he0t35 he0t34 he0t33 he0t32 he0t31 he0t30 reset: xxxxxxxx $0034 usb hub endpoint 0 data register 4 (he0d4) read: he0r47 he0r46 he0r45 he0r44 he0r43 he0r42 he0r41 he0r40 write: he0t47 he0t46 he0t45 he0t44 he0t43 he0t42 he0t41 he0t40 reset: xxxxxxxx $0035 usb hub endpoint 0 data register 5 (he0d5) read: he0r57 he0r56 he0r55 he0r54 he0r53 he0r52 he0r51 he0r50 write: he0t57 he0t56 he0t55 he0t54 he0t53 he0t52 he0t51 he0t50 reset: xxxxxxxx $0036 usb hub endpoint 0 data register 6 (he0d6) read: he0r67 he0r66 he0r65 he0r64 he0r63 he0r62 he0r61 he0r60 write: he0t67 he0t66 he0t65 he0t64 he0t63 he0t62 he0t61 he0t60 reset: xxxxxxxx $0037 usb hub endpoint 0 data register 7 (he0d7) read: he0r77 he0r76 he0r75 he0r74 he0r73 he0r72 he0r71 he0r70 write: he0t77 he0t76 he0t75 he0t74 he0t73 he0t72 he0t71 he0t70 reset: xxxxxxxx
universal serial bus module (usb) advance information mc68hc(7)08kh12 ? rev. 1.0 120 universal serial bus module (usb) motorola 9.4.1 usb hub root port control register (hrpcr) resum0 ?force resume to the root port this read/write bit forces a resume signal (??state) onto the usb root port data lines to initiate a remote wakeup. software should control the timing of the forced resume to be between 10 ms and 15 ms. reset clears this bit. 1 = force root port data lines to ??state 0 = default suspnd ?usb suspend control bit to save power, this read/write bit should be set by the software if at least 3ms constant idle state is detected on usb bus. setting this bit puts the transceiver and regulator into a power savings mode. this bit also determines the latch scheme for the data lines of the root port and the downstream port. when this bit is 1, the current state shown on the data lines will be reflected to the data register (d+/d? directly. when the bit is 0, the data registers are the latched state sampled at the last eof2 sample point. the hub repeater? function is affected by this bit too. the upstream and downstream traffic will be blocked if this bit is set to 1. when the global resume or the downstream remote wakeup signal is found by the suspend hub, software is responsible to propagate the traffic between the root port and the enabled downstream port by setting the resumx control bit. reset clears this bit. address: $005e bit 7 654321 bit 0 read: 0 0 0 resum0 suspnd 0 d0+ d0 write: reset: 000000xx = unimplemented x = indeterminate figure 9-2. usb hub root port control register (hrpcr)
universal serial bus module (usb) i/o register description of the hub function mc68hc(7)08kh12 ? rev. 1.0 advance information motorola universal serial bus module (usb) 121 eof2 is generated by kh12 every millisecond, if sof is not detected when three or more eof2 has occurred, software can set the suspnd-bit and put kh12 into suspend mode. d0+/d0??root port differential data these read only bits are the differential data shown on the hub root ports. when the bit suspnd is 0, the data is the latched state at the last eof2 sample point. when the bit suspnd is 1, the data reflects the current state on the data line while accessing this register. 9.4.2 usb hub downstream port control register (hdp1cr-hdp4cr) pen1-pen4 ?downstream port enable control bit this read/write bit determines whether the enabled or disabled state should be assigned to the downstream port. setting this bit 1 to enable the port and clear the bit to disable the port. in the enabled state a full-speed port propagates all downstream signaling, a low- speed port propagates downstream low-speed packet traffic when preceded by the preamble pid. an enabled port propagates all upstream signaling including full speed and low speed packets. this address: $0051 bit 7 654321 bit 0 read: pen1 lowsp1 rst1 resum1 susp1 0 d1+ d1 write: reset: 000000xx address: $0054 read: pen4 lowsp4 rst4 resum4 susp4 0 d4+ d4 write: reset: 000000xx = unimplemented x = indeterminate figure 9-3. usb hub downstream port control registers (hdp1cr-hdp4cr)
universal serial bus module (usb) advance information mc68hc(7)08kh12 ? rev. 1.0 122 universal serial bus module (usb) motorola bit can be set to 1 by the host request only. it can be cleared either by hardware when a fault condition was detected or by software through the host request. reset clears this bit. 1 = downstream port is enabled 0 = downstream port is disabled lowsp1-lowsp4 ?full speed / low speed port control bit this read/write bit specifies the attached device in the downstream port is low speed device or full speed device. software is responsible to detect the device attachment and whether a device is full or low speed. reset clears this bit. 1 = downstream port is low speed 0 = downstream port is full speed note: after a port is enabled, hub will automatically generate a low speed keep awake signal to the port every millisecond. rst1-rst4 ?force reset to the downstream port this read/write bit forces a reset signal (se0 state) onto the usb downstream port data lines. this bit can be set by the host request setportfeature (port_reset) only. software should control the timing of the forced reset signaling downstream for at least 10 ms. reset clears this bit. 1 = force downstream port data lines to se0 state 0 = default resum1-resum4 ?force resume to the downstream port this read/write bit forces a resume signal (??state) onto the usb downstream port data lines. this bit is set to reflect the resume signal when the software detects the remote resume signal on the data lines of the selective suspend downstream port. downstream selective resume sequence to a port may also be initiated via the host request clearportfeature (port_suspend). software should control the timing of the forced resume signaling downstream for at least 20 ms. to indicate the end of the resume, a low speed eop signal will be followed when this control bit changes from 1 to 0. reset clears this bit. 1 = force downstream port data lines to ??state 0 = default
universal serial bus module (usb) i/o register description of the hub function mc68hc(7)08kh12 ? rev. 1.0 advance information motorola universal serial bus module (usb) 123 susp1-susp4 ?downstream port selective suspend bit this read/write bit forces the downstream port entering the selective suspend mode. this bit can be set by the host request setportfeature (port_suspend) only. when this bit is set, the hub prevents propagating any bus activity (except the port reset or port resume request or the global reset signal) downstream, and the port can only reflect upstream bus state changes via the endpoint 1 of the hub. the blocking occurs at the next eof2 point when this bit is set. reset clears this bit. 1 = force downstream port enters the selective suspend mode 0 = default d1+/d1?to d4+/d4??downstream port differential data these read only bits are the differential data shown on the hub downstream ports. when the bit suspnd in the register hrpcr is 0, the data is the latched state at the last eof2 sample point. when the bit suspnd is 1, the data reflects the current state on the data line while accessing this register. 9.4.3 usb sie timing interrupt register (sietir) address: $0056 bit 7 654321 bit 0 read: soff eof2f eopf tranf sofie eof2ie eopie tranie write: reset: 00000000 = unimplemented figure 9-4. usb sie timing interrupt register (sietir)
universal serial bus module (usb) advance information mc68hc(7)08kh12 ? rev. 1.0 124 universal serial bus module (usb) motorola soff ?start of frame detect flag this read only bit is set when a valid sof pid is detected on the d0+ and d0?lines at the root port. software must clear this flag by writing a logic 1 to soffr bit in the sietsr register. reset clears this bit. writing to soff has no effect. 1 = start of frame pid has been detected 0 = start of frame pid has not been detected eof2f ?the second end of frame point flag this read only bit is set when the internal frame timer counts to the bit time that the hub must see upstream traffic terminated near the end of frame. this bit time is defined as 10 bit times from the next start of frame pid. software must clear this flag by writing a logic 1 to eof2fr bit in the sietsr register. reset clears this bit. writing to eof2f has no effect. 1 = frame timer counts to the eof2 point 0 = frame timer does not count to the eof2 point eopf ?end of packet detect flag this read only bit is set when a valid end-of-packet sequence is detected on the d0+ and d0?lines. software must clear this flag by writing a logic 1 to the eopfr bit in the sietsr register. reset clears this bit. writing to eopf has no effect. 1 = end-of-packet sequence has been detected 0 = end-of-packet sequence has not been detected tranf ?bus signal transition detect flag this read only bit is set if there is any bus activity on the upstream or the downstream data lines. generally speaking, this bit is used to wakeup the suspended hub when there is any bus activity occurred. software must clear this flag by writing a logic 1 to the tranfr bit in the sietsr register. reset clears this bit. writing to tranf has no effect. 1 = signal transition has been detected 0 = signal transition has not been detected
universal serial bus module (usb) i/o register description of the hub function mc68hc(7)08kh12 ? rev. 1.0 advance information motorola universal serial bus module (usb) 125 sofie ?start of frame interrupt enable this read/write bit enables the start of frame to generate a usb interrupt when the soff bit becomes set. reset clears this bit. 1 = usb interrupt enabled for start of frame 0 = usb interrupt disabled for start of frame eof2ie ?the second end of frame point interrupt enable this read/write bit enables the second end of frame to generate a usb interrupt when the eof2f bit becomes set. reset clears this bit. 1 = usb interrupt enabled for the second end of frame point 0 = usb interrupt disabled for the second end of frame point eopie ?end of packet detect interrupt enable this read/write bit enables the usb to generate a interrupt request when the eopf bit becomes set. reset clears the bit. 1 = usb interrupt enabled for end-of-packet sequence detection 0 = usb interrupt disabled for end-of-packet sequence detection tranie ?bus signal transition detect interrupt enable this read/write bit enables the signal transition to generate a usb interrupt when the tranf bit becomes set. reset clears this bit. 1 = usb interrupt enabled for bus signal transition 0 = usb interrupt disabled for bus signal transition 9.4.4 usb sie timing status register (sietsr) address: $0057 bit 7 654321 bit 0 read: rstf 0 lockf 00000 write: rstfr lockfr soffr eof2fr eopfr tranfr reset: 0** 0000000 = unimplemented 0** = reset by por only figure 9-5. usb sie timing status register (sietsr)
universal serial bus module (usb) advance information mc68hc(7)08kh12 ? rev. 1.0 126 universal serial bus module (usb) motorola rstf ?usb reset flag this read only bit is set when a valid reset signal state is detected on the d0+ and d0- lines. this reset detection will also generate an internal reset signal to reset the cpu and other peripherals including the usb module. this bit is cleared by writing a logic 1 to the rstfr bit. note: ** please note rstf bit is only be reset by a por reset. rstfr ?clear reset indicator bit writing a logic 1 to this write only bit will clear the rstf bit if it is set. writing a logic 0 to the rstfr has no effect. reset clears this bit. lockf ?usb frame timer locked this read only bit is set when the internal frame timer is locked to the host timer. this bit is cleared by writing a logic 1 to the lockfr bit. reset clears this bit. lockfr ?clear frame timer locked flag writing a logic 1 to this write only bit will clear the lockf bit if it is set. writing a logic 0 to the lockfr has no effect. reset clears this bit. soffr ?start of frame flag reset writing a logic 1 to this write only bit will clear the soff bit if it is set. writing a logic 0 to the soffr has no effect. reset clears this bit. eof2fr ?the second end of frame point flag reset writing a logic 1 to this write only bit will clear the eof2f bit if it is set. writing a logic 0 to the eof2fr has no effect. reset clears this bit. eopfr ?end of packet flag reset writing a logic 1 to this write only bit will clear the eopf bit if it is set. writing a logic 0 to the eopfr has no effect. reset clears this bit. tranfr ?bus signal transition flag reset writing a logic 1 to this write only bit will clear the tranf bit if it is set. writing a logic 0 to the tranfr has no effect. reset clears this bit.
universal serial bus module (usb) i/o register description of the hub function mc68hc(7)08kh12 ? rev. 1.0 advance information motorola universal serial bus module (usb) 127 9.4.5 usb hub address register (haddr) usben ?usb module enable this read/write bit enables and disables the usb module. when usben is cleared, the usb module will not respond to any tokens and the external regulated output regout will be turned off. note: **usben bit can only be cleared by a por reset. 1 = usb function enabled 0 = usb function disabled, usb transceiver is also disabled to save power. add6-add0 ?usb hub function address these bits specify the address of the hub function. reset clears these bits. address: $0058 bit 7 654321 bit 0 read: usben add6 add5 add4 add3 add2 add1 add0 write: reset: 0** 0000000 0** = reset by por only figure 9-6. usb hub address register (haddr)
universal serial bus module (usb) advance information mc68hc(7)08kh12 ? rev. 1.0 128 universal serial bus module (usb) motorola 9.4.6 usb hub interrupt register 0 (hir0) txdf ?hub endpoint 0 data transmit flag this read only bit is set after the data stored in hub endpoint 0 transmit buffers has been sent and an ack handshake packet from the host is received. once the next set of data is ready in the transmit buffers, software must clear this flag by writing a logic 1 to the txdfr bit. to enable the next data packet transmission, txe must also be set. if txdf bit is not cleared, a nak handshake will be returned in the next in transaction. reset clears this bit. writing to txdf has no effect. 1 = transmit on hub endpoint 0 has occurred 0 = transmit on hub endpoint 0 has not occurred rxdf ?hub endpoint 0 data receive flag this read only bit is set after the usb hub function has received a data packet and responded with an ack handshake packet. software must clear this flag by writing a logic 1 to the rxdfr bit after all of the received data has been read. software must also set rxe bit to one to enable the next data packet reception. if rxdf bit is not cleared, a nak handshake will be returned in the next out transaction. reset clears this bit. writing to rxdf has no effect. 1 = receive on hub endpoint 0 has occurred 0 = receive on hub endpoint 0 has not occurred address: $0059 bit 7 654321 bit 0 read: txdf rxdf 0 0 txdie rxdie 0 0 write: txdfr rxdfr reset: 00000000 = unimplemented figure 9-7. usb hub interrupt register 0 (hir0)
universal serial bus module (usb) i/o register description of the hub function mc68hc(7)08kh12 ? rev. 1.0 advance information motorola universal serial bus module (usb) 129 txdie ?hub endpoint 0 transmit interrupt enable this read/write bit enables the transmit hub endpoint 0 to generate cpu interrupt requests when the txdf bit becomes set. reset clears the txdie bit. 1 = usb interrupt enabled for transmit hub endpoint 0 0 = usb interrupt disabled for transmit hub endpoint 0 rxdie ?hub endpoint 0 receive interrupt enable this read/write bit enables the receive hub endpoint 0 to generate cpu interrupt requests when the rxdf bit becomes set. reset clears the rxdie bit. 1 = usb interrupt enabled for receive hub endpoint 0 0 = usb interrupt disabled for receive hub endpoint 0 txdfr ?hub endpoint 0 transmit flag reset writing a logic 1 to this write only bit will clear the txdf bit if it is set. writing a logic 0 to txdfr has no effect. reset clears this bit. rxdfr ?hub endpoint 0 receive flag reset writing a logic 1 to this write only bit will clear the rxdf bit if it is set. writing a logic 0 to rxdfr has no effect. reset clears this bit. 9.4.7 usb hub control register 0 (hcr0) address: $005b bit 7 654321 bit 0 read: tseq stall0 txe rxe tpsiz3 tpsiz2 tpsiz1 tpsiz0 write: reset: 00000000 figure 9-8. usb hub control register 0 (hcr0)
universal serial bus module (usb) advance information mc68hc(7)08kh12 ? rev. 1.0 130 universal serial bus module (usb) motorola tseq ?hub endpoint 0 transmit sequence bit this read/write bit determines which type of data packet (data0 or data1) will be sent during the next in transaction directed at endpoint 0. toggling of this bit must be controlled by software. reset clears this bit. 1 = data1 token active for next hub endpoint 0 transmit 0 = data0 token active for next hub endpoint 0 transmit stall0 ?hub endpoint 0 force stall bit this read/write bit causes hub endpoint 0 to return a stall handshake when polled by either an in or out token by the host. the usb hardware clears this bit when a setup token is received. reset clears this bit. 1 = send stall handshake 0 = default txe ?hub endpoint 0 transmit enable this read/write bit enables a transmit to occur when the usb host controller sends an in token to the hub endpoint 0. software should set this bit when data is ready to be transmitted. it must be cleared by software when no more hub endpoint 0 data packets needs to be transmitted. if this bit is 0 or the txdf is set, the usb will respond with a nak handshake to any hub endpoint 0 in tokens. reset clears this bit. 1 = data is ready to be sent 0 = data is not ready. respond with nak rxe ?hub endpoint 0 receive enable this read/write bit enables a receive to occur when the usb host controller sends an out token to the hub endpoint 0. software should set this bit when data is ready to be received. it must be cleared by software when data cannot be received. if this bit is 0 or the rxdf is set, the usb will respond with a nak handshake to any hub endpoint 0 out tokens. reset clears this bit. 1 = data is ready to be received 0 = not ready for data. respond with nak
universal serial bus module (usb) i/o register description of the hub function mc68hc(7)08kh12 ? rev. 1.0 advance information motorola universal serial bus module (usb) 131 tpsiz3-tpsiz0 ?hub endpoint 0 transmit data packet size these read/write bits store the number of transmit data bytes for the next in token request for hub endpoint 0. these bits are cleared by reset. 9.4.8 usb hub endpoint1 control & data register (hcdr) stall1 ?hub endpoint 1 force stall bit this read/write bit causes hub endpoint 1 to return a stall handshake when polled by the host. reset clears this bit. 1 = send stall handshake 0 = default pnew ?port new status change this read/write bit enables a transmit to occur when the usb host controller sends an in token to hub endpoint 1. software should set this bit when there is any status change on the downstream ports, embedded device or hub. it must be cleared by software when there is no status change needs to be reported to the host through the endpoint1. if this bit is 0, a nak handshake will be returned for next in token for hub endpoint 1. reset clears this bit. 1 = port status change bit is ready to be sent. 0 = port status does not change. respond with nak. address: $005c bit 7 654321 bit 0 read: stall1 pnew pchg5 pchg4 pchg3 pchg2 pchg1 pchg0 write: reset: 00000000 figure 9-9. usb hub control register 1 (hcr1)
universal serial bus module (usb) advance information mc68hc(7)08kh12 ? rev. 1.0 132 universal serial bus module (usb) motorola pchg5-pchg0 ?hub and port status change bits these read/write bits report the status change for the hub, embedded device and the four downstream ports. the status change bitmap is returned to the host through the hub endpoint 1 if the bit pnew is 1. these bits are cleared by reset. 9.4.9 usb hub status register (hsr) bit name function value description pchg0 hub status change 0 no status change in hub 1 hub status change detected pchg1 port 1 status change 0 no status change in port 1 1 port 1 status change detected pchg2 port 2 status change 0 no status change in port 2 1 port 2 status change detected pchg3 port 3 status change 0 no status change in port 3 1 port 3 status change detected pchg4 port 4 status change 0 no status change in port 4 1 port 4 status change detected pchg5 embedded device status change 0 no status change in embedded device 1 embedded device status change detected address: $005d bit 7 654321 bit 0 read: rseq setup tx1st 0 rpsiz3 rpsiz2 rpsiz1 rpsiz0 write: tx1str reset: x x 0 0 xxxx = unimplemented x = indeterminate figure 9-10. usb hub status register (hsr)
universal serial bus module (usb) i/o register description of the hub function mc68hc(7)08kh12 ? rev. 1.0 advance information motorola universal serial bus module (usb) 133 rseq ?hub endpoint 0 receive sequence bit this read only bit indicates the type of data packet last received for hub endpoint 0 (data0 or data1). 1 = data1 token received in last hub endpoint 0 receive 0 = data0 token received in last hub endpoint 0 receive setup ?hub setup token detect bit this read only bit indicates that a valid setup token has been received. 1 = last token received for hub endpoint 0 was a setup token 0 = last token received for hub endpoint 0 was not a setup token tx1st ?hub transmit first flag this read only bit is set if the hub endpoint 0 data transmit flag (txdf) is set when the usb control logic is setting the hub endpoint 0 data receive flag (rxdf). in other words, if an unserviced endpoint 0 transmit flag is still set at the end of an endpoint 0 reception, then this bit will be set. this bit lets the firmware know that the endpoint 0 transmission happened before the endpoint 0 reception. reset clears this bit. 1 = in transaction occurred before setup/out 0 = in transaction occurred after setup/out tx1str ?clear hub transmit first flag writing a logic 1 to this write only bit will clear the tx1st bit if it is set. writing a logic 0 to the tx1str has no effect. reset clears this bit. rpsiz3-rpsiz0 ?hub endpoint 0 receive data packet size these read only bits store the number of data bytes received for the last out or setup transaction for hub endpoint 0. these bits are not affected by reset.
universal serial bus module (usb) advance information mc68hc(7)08kh12 ? rev. 1.0 134 universal serial bus module (usb) motorola 9.4.10 usb hub endpoint 0 data registers 0-7 (he0d0-he0d7) he0rx7-he0rx0 ?hub endpoint 0 receive data buffer these read only bits are serially loaded with out token or setup token data directed at hub endpoint 0. the data is received over the usb? d0+ and d0?pins. he0tx7-he0tx0 ?hub endpoint 0 transmit data buffer these write only buffers are loaded by software with data to be sent on the usb bus on the next in token directed at hub endpoint 0. 9.5 i/o register description of the embedded device function the usb embedded device function provides a set of control/status registers and twenty-four data registers that provide storage for the buffering of data between the usb embedded device function and the cpu. these registers are shown in table 9-3 and table 9-4 . address: $0030 bit 7 654321 bit 0 read: he0r07 he0r06 he0r05 he0r04 he0r03 he0r02 he0r01 he0r00 write: he0t07 he0t06 he0t05 he0t04 he0t03 he0t02 he0t01 he0t00 reset: xxxxxxxx address: $0037 read: he0r77 he0r76 he0r75 he0r74 he0r73 he0r72 he0r71 he0r70 write: he0t77 he0t76 he0t75 he0t74 he0t73 he0t72 he0t71 he0t70 reset: xxxxxxxx x = indeterminate figure 9-11. usb hub endpoint 0 data register (he0d0-he0d7)
universal serial bus module (usb) i/o register description of the embedded device function mc68hc(7)08kh12 ? rev. 1.0 advance information motorola universal serial bus module (usb) 135 table 9-3. embedded device control register summary addr. register name bit 7 654321 bit 0 $0047 usb embedded device control register 2 (dcr2) read: 0000 enable2 enable1 dstall2 dstall1 write: reset: 00000000 $0048 usb embedded device address register (daddr) read: deven dadd6 dadd5 dadd4 dadd3 dadd2 dadd1 dadd0 write: reset: 00000000 $0049 usb embedded device interrupt register 0 (dir0) read: txd0f rxd0f 0 0 txd0ie rxd0ie 00 write: txd0fr rxd0fr reset: 00000000 $004a usb embedded device interrupt register 1 (dir1) read: txd1f 0 0 0 txd1ie 000 write: txd1fr reset: 00000000 $004b usb embedded device control register 0 (dcr0) read: t0seq dstall0 tx0e rx0e tp0siz3 tp0siz2 tp0siz1 tp0siz0 write: reset: 00000000 $004c usb embedded device control register 1 (dcr1) read: t1seq endadd tx1e 0 tp1siz3 tp1siz2 tp1siz1 tp1siz0 write: reset: 00000000 $004d usb embedded device status register (dsr) read: drseq dsetup dtx1st 0 rp0siz3 rp0siz2 rp0siz1 rp0siz0 write: dtx1str reset: x x 0 0 xxxx = unimplemented x = indeterminate
universal serial bus module (usb) advance information mc68hc(7)08kh12 ? rev. 1.0 136 universal serial bus module (usb) motorola table 9-4. embedded device data register summary addr. register name bit 7 654321 bit 0 $0020 usb embedded device endpoint 0 data register 0 (de0d0) read: de0r07 de0r06 de0r05 de0r04 de0r03 de0r02 de0r01 de0r00 write: de0t07 de0t06 de0t05 de0t04 de0t03 de0t02 de0t01 de0t00 reset: xxxxxxxx $0021 usb embedded device endpoint 0 data register 1 (de0d1) read: de0r17 de0r16 de0r15 de0r14 de0r13 de0r12 de0r11 de0r10 write: de0t17 de0t16 de0t15 de0t14 de0t13 de0t12 de0t11 de0t10 reset: xxxxxxxx $0022 usb embedded device endpoint 0 data register 2 (de0d2) read: de0r27 de0r26 de0r25 de0r24 de0r23 de0r22 de0r21 de0r20 write: de0t27 de0t26 de0t25 de0t24 de0t23 de0t22 de0t21 de0t20 reset: xxxxxxxx $0023 usb embedded device endpoint 0 data register 3 (de0d3) read: de0r37 de0r36 de0r35 de0r34 de0r33 de0r32 de0r31 de0r30 write: de0t37 de0t36 de0t35 de0t34 de0t33 de0t32 de0t31 de0t30 reset: xxxxxxxx $0024 usb embedded device endpoint 0 data register 4 (de0d4) read: de0r47 de0r46 de0r45 de0r44 de0r43 de0r42 de0r41 de0r40 write: de0t47 de0t46 de0t45 de0t44 de0t43 de0t42 de0t41 de0t40 reset: xxxxxxxx $0025 usb embedded device endpoint 0 data register 5 (de0d5) read: de0r57 de0r56 de0r55 de0r54 de0r53 de0r52 de0r51 de0r50 write: de0t57 de0t56 de0t55 de0t54 de0t53 de0t52 de0t51 de0t50 reset: xxxxxxxx $0026 usb embedded device endpoint 0 data register 6 (de0d6) read: de0r67 de0r66 de0r65 de0r64 de0r63 de0r62 de0r61 de0r60 write: de0t67 de0t66 de0t65 de0t64 de0t63 de0t62 de0t61 de0t60 reset: xxxxxxxx $0027 usb embedded device endpoint 0 data register 7 (de0d7) read: de0r77 de0r76 de0r75 de0r74 de0r73 de0r72 de0r71 de0r70 write: de0t77 de0t76 de0t75 de0t74 de0t73 de0t72 de0t71 de0t70 reset: xxxxxxxx
universal serial bus module (usb) i/o register description of the embedded device function mc68hc(7)08kh12 ? rev. 1.0 advance information motorola universal serial bus module (usb) 137 $0028 usb embedded device endpoint 1/2 data register 0 (de1d0) read: write: de1t07 de1t06 de1t05 de1t04 de1t03 de1t02 de1t01 de1t00 reset: xxxxxxxx $0029 usb embedded device endpoint 1/2 data register 1 (de1d1) read: write: de1t17 de1t16 de1t15 de1t14 de1t13 de1t12 de1t11 de1t10 reset: xxxxxxxx $002a usb embedded device endpoint 1/2 data register 2 (de1d2) read: write: de1t27 de1t26 de1t25 de1t24 de1t23 de1t22 de1t21 de1t20 reset: xxxxxxxx $002b usb embedded device endpoint 1/2 data register 3 (de1d3) read: write: de1t37 de1t36 de1t35 de1t34 de1t33 de1t32 de1t31 de1t30 reset: xxxxxxxx $002c usb embedded device endpoint 1/2 data register 4 (de1d4) read: write: de1t47 de1t46 de1t45 de1t44 de1t43 de1t42 de1t41 de1t40 reset: xxxxxxxx $002d usb embedded device endpoint 1/2 data register 5 (de1d5) read: write: de1t57 de1t56 de1t55 de1t54 de1t53 de1t52 de1t51 de1t50 reset: xxxxxxxx $002e usb embedded device endpoint 1/2 data register 6 (de1d6) read: write: de1t67 de1t66 de1t65 de1t64 de1t63 de1t62 de1t61 de1t60 reset: xxxxxxxx $002f usb embedded device endpoint 1/2 data register 7 (de1d7) read: write: de1t77 de1t76 de1t75 de1t74 de1t73 de1t72 de1t71 de1t70 reset: xxxxxxxx
universal serial bus module (usb) advance information mc68hc(7)08kh12 ? rev. 1.0 138 universal serial bus module (usb) motorola 9.5.1 usb embedded device address register (daddr) deven ?enable usb embedded device these bit enable or disable the embedded device function. it is used together with pen1-pen4 to control the enumeration sequence. reset clears these bits. 1 = usb embedded device enabled 0 = usb embedded device disabled dadd6-dadd0 ?usb embedded device function address these bits specify the address of the embedded device function. reset clears these bits. 9.5.2 usb embedded device interrupt register 0 (dir0) address: $0048 bit 7 654321 bit 0 read: deven dadd6 dadd5 dadd4 dadd3 dadd2 dadd1 dadd0 write: reset: 00000000 figure 9-12. usb embedded device address register (daddr) address: $0049 bit 7 654321 bit 0 read: txd0f rxd0f 0 0 txd0ie rxd0ie 0 0 write: txd0fr rxd0fr reset: 00000000 = unimplemented figure 9-13. usb embedded device interrupt register 0 (dir0)
universal serial bus module (usb) i/o register description of the embedded device function mc68hc(7)08kh12 ? rev. 1.0 advance information motorola universal serial bus module (usb) 139 txd0f ?embedded device endpoint 0 data transmit flag this read only bit is set after the data stored in embedded device endpoint 0 transmit buffers has been sent and an ack handshake packet from the host is received. once the next set of data is ready in the transmit buffers, software must clear this flag by writing a logic 1 to the txd0fr bit. to enable the next data packet transmission, tx0e must also be set. if txd0f bit is not cleared, a nak handshake will be returned in the next in transaction. reset clears this bit. writing to txd0f has no effect. 1 = transmit on embedded device endpoint 0 has occurred 0 = transmit on embedded device endpoint 0 has not occurred rxd0f ?embedded device endpoint 0 data receive flag this read only bit is set after the usb embedded device module has received a data packet and responded with an ack handshake packet. software must clear this flag by writing a logic 1 to the rxd0fr bit after all of the received data has been read. software must also set rx0e bit to one to enable the next data packet reception. if rxd0f bit is not cleared, a nak handshake will be returned in the next out transaction. reset clears this bit. writing to rxd0f has no effect. 1 = receive on embedded device endpoint 0 has occurred 0 = receive on embedded device endpoint 0 has not occurred txd0ie ?embedded device endpoint 0 transmit interrupt enable this read/write bit enables the transmit embedded device endpoint 0 to generate cpu interrupt requests when the txd0f bit becomes set. reset clears the txd0ie bit. 1 = transmit embedded device endpoint 0 can generate a cpu interrupt request 0 = transmit embedded device endpoint 0 cannot generate a cpu interrupt request rxd0ie ?embedded device endpoint 0 receive interrupt enable this read/write bit enables the receive embedded device endpoint 0 to generate cpu interrupt requests when the rxd0f bit becomes set. reset clears the rxd0ie bit.
universal serial bus module (usb) advance information mc68hc(7)08kh12 ? rev. 1.0 140 universal serial bus module (usb) motorola 1 = receive embedded device endpoint 0 can generate a cpu interrupt request 0 = receive embedded device endpoint 0 cannot generate a cpu interrupt request txd0fr ?embedded device endpoint 0 transmit flag reset writing a logic 1 to this write only bit will clear the txd0f bit if it is set. writing a logic 0 to txd0fr has no effect. reset clears this bit. rxd0fr ?embedded device endpoint 0 receive flag reset writing a logic 1 to this write only bit will clear the rxd0f bit if it is set. writing a logic 0 to rxd0fr has no effect. reset clears this bit. 9.5.3 usb embedded device interrupt register 1 (dir1) txd1f ?embedded device endpoint 1/2 data transmit flag this read only bit is shared by endpoint 1 and endpoint 2 of the embedded device. it is set after the data stored in the shared endpoint 1/2 transmit buffer of the embedded device has been sent and an ack handshake packet from the host is received. once the next set of data is ready in the transmit buffers, software must clear this flag by writing a logic 1 to the txd1fr bit. to enable the next data packet transmission, tx1e must also be set. if txd1f bit is not cleared, a nak handshake will be returned in the next in transaction. reset clears this bit. writing to txd1f has no effect. address: $004a bit 7 654321 bit 0 read: txd1f 0 0 0 txd1ie 0 0 0 write: txd1fr reset: 00000000 = unimplemented figure 9-14. usb embedded device interrupt register 1 (dir1)
universal serial bus module (usb) i/o register description of the embedded device function mc68hc(7)08kh12 ? rev. 1.0 advance information motorola universal serial bus module (usb) 141 1 = transmit on endpoint 1 or endpoint 2 of the embedded device has occurred 0 = transmit on endpoint 1 or endpoint 2 of the embedded device has not occurred txd1ie ?embedded device endpoint 1/2 transmit interrupt enable this read/write bit enables the usb to generate cpu interrupt requests when the shared transmit endpoint 1/2 interrupt flag bit of the embedded device (txd1f) becomes set. reset clears the txd1ie bit. 1 = transmit embedded device endpoints 1 and 2 can generate a cpu interrupt request 0 = transmit embedded device endpoints 1 and 2 cannot generate a cpu interrupt request txd1fr ?embedded device endpoint 1/2 transmit flag reset writing a logic 1 to this write only bit will clear the txd1f bit if it is set. writing a logic 0 to txd1fr has no effect. reset clears this bit. 9.5.4 usb embedded device control register 0 (dcr0) t0seq ?embedded device endpoint 0 transmit sequence bit this read/write bit determines which type of data packet (data0 or data1) will be sent during the next in transaction directed at endpoint 0. toggling of this bit must be controlled by software. reset clears this bit. address: $004b bit 7 654321 bit 0 read: t0seq dstall0 tx0e rx0e tp0siz3 tp0siz2 tp0siz1 tp0siz0 write: reset: 00000000 figure 9-15. usb embedded device control register 0 (dcr0)
universal serial bus module (usb) advance information mc68hc(7)08kh12 ? rev. 1.0 142 universal serial bus module (usb) motorola 1 = data1 token active for next embedded device endpoint 0 transmit 0 = data0 token active for next embedded device endpoint 0 transmit dstall0 ?embedded device endpoint 0 force stall bit this read/write bit causes embedded device endpoint 0 to return a stall handshake when polled by either an in or out token by the host. the usb hardware clears this bit when a setup token is received. reset clears this bit. 1 = send stall handshake 0 = default tx0e ?embedded device endpoint 0 transmit enable this read/write bit enables a transmit to occur when the usb host controller sends an in token to the embedded device endpoint 0. software should set this bit when data is ready to be transmitted. it must be cleared by software when no more embedded device endpoint 0 data needs to be transmitted. if this bit is 0 or the txd0f is set, the usb will respond with a nak handshake to any embedded device endpoint 0 in tokens. reset clears this bit. 1 = data is ready to be sent 0 = data is not ready. respond with nak rx0e ?embedded device endpoint 0 receive enable this read/write bit enables a receive to occur when the usb host controller sends an out token to the embedded device endpoint 0. software should set this bit when data is ready to be received. it must be cleared by software when data cannot be received. if this bit is 0 or the rxd0f is set, the usb will respond with a nak handshake to any embedded device endpoint 0 out tokens. reset clears this bit. 1 = data is ready to be received 0 = not ready for data. respond with nak
universal serial bus module (usb) i/o register description of the embedded device function mc68hc(7)08kh12 ? rev. 1.0 advance information motorola universal serial bus module (usb) 143 tp0siz3-tp0siz0 ?embedded device endpoint 0 transmit data packet size these read/write bits store the number of transmit data bytes for the next in token request for embedded device endpoint 0. these bits are cleared by reset. 9.5.5 usb embedded device control register 1 (dcr1) t1seq ?embedded device endpoint 1/2 transmit sequence bit this read/write bit determines which type of data packet (data0 or data1) will be sent during the next in transaction directed to embedded device endpoint 1 or 2. toggling of this bit must be controlled by software. reset clears this bit. 1 = data1 token active for next embedded device endpoint 1/2 transmit 0 = data0 token active for next embedded device endpoint 1/2 transmit endadd ?endpoint address select this read/write bit specifies whether the data inside the registers de1d0-de1d7 are used for embedded device endpoint 1 or 2. if all the conditions for a successful endpoint 2 usb response to a host? in token are satisfied (txd1f=0, tx1e=1, dstall2=0, and enable2=1) except that the endadd bit is configured for endpoint 1, the usb responds with a nak handshake packet. reset clears this bit. address: $004c bit 7 654321 bit 0 read: t1seq endadd tx1e 0 tp1siz3 tp1siz2 tp1siz1 tp1siz0 write: reset: 00000000 = unimplemented figure 9-16. usb embedded device control register 1 (dcr1)
universal serial bus module (usb) advance information mc68hc(7)08kh12 ? rev. 1.0 144 universal serial bus module (usb) motorola 1 = the data buffers are used for embedded device endpoint 2 0 = the data buffers are used for embedded device endpoint 1 tx1e ?embedded device endpoint 1/2 transmit enable this read/write bit enables a transmit to occur when the usb host controller sends an in token to endpoint 1 or endpoint 2 of the embedded device. the appropriate endpoint enable bit, enable1 or enable2 bit in the dcr2 register, should also be set. software should set the tx1e bit when data is ready to be transmitted. it must be cleared by software when no more data needs to be transmitted. if this bit is 0 or the txd1f is set, the usb will respond with a nak handshake to any endpoint 1 or endpoint 2 directed in tokens. reset clears this bit. 1 = data is ready to be sent. 0 = data is not ready. respond with nak. tp1siz3-tp1siz0 ?embedded device endpoint 1/2 transmit data packet size these read/write bits store the number of transmit data bytes for the next in token request for embedded device endpoint 1 or endpoint 2. these bits are cleared by reset. 9.5.6 usb embedded device status register (dsr) address: $004d bit 7 654321 bit 0 read: drseq dsetup dtx1st 0 rp0siz3 rps0iz2 rp0siz1 rp0siz0 write: dtx1str reset: x x 0 0 xxxx = unimplemented x = indeterminate figure 9-17. usb embedded device status register (dsr)
universal serial bus module (usb) i/o register description of the embedded device function mc68hc(7)08kh12 ? rev. 1.0 advance information motorola universal serial bus module (usb) 145 drseq ?embedded device endpoint 0 receive sequence bit this read only bit indicates the type of data packet last received for embedded device endpoint 0 (data0 or data1). 1 = data1 token received in last embedded device endpoint 0 receive 0 = data0 token received in last embedded device endpoint 0 receive dsetup ?embedded device setup token detect bit this read only bit indicates that a valid setup token has been received. 1 = last token received for endpoint 0 was a setup token 0 = last token received for endpoint 0 was not a setup token dtx1st ?embedded device transmit first flag this read only bit is set if the embedded device endpoint 0 data transmit flag (txd0f) is set when the usb control logic is setting the embedded device endpoint 0 data receive flag (rxd0f). in other words, if an unserviced endpoint 0 transmit flag is still set at the end of an endpoint 0 reception, then this bit will be set. this bit lets the firmware know that the endpoint 0 transmission happened before the endpoint 0 reception. reset clears this bit. 1 = in transaction occurred before setup/out 0 = in transaction occurred after setup/out dtx1str ?clear transmit first flag writing a logic 1 to this write only bit will clear the dtx1st bit if it is set. writing a logic 0 to the dtx1str has no effect. reset clears this bit. rp0siz3-rp0siz0 ?embedded device endpoint 0 receive data packet size these read only bits store the number of data bytes received for the last out or setup transaction for embedded device endpoint 0. these bits are not affected by reset.
universal serial bus module (usb) advance information mc68hc(7)08kh12 ? rev. 1.0 146 universal serial bus module (usb) motorola 9.5.7 usb embedded device control register 2 (dcr2) enable2 ?embedded device endpoint 2 enable this read/write bit enables embedded device endpoint 2 and allows the usb to respond to in packets addressed to this endpoint. reset clears this bit. 1 = embedded device endpoint 2 is enabled and can respond to an in token 0 = embedded device endpoint 2 is disabled enable1 ?embedded device endpoint 1 enable this read/write bit enables embedded device endpoint 1 and allows the usb to respond to in packets addressed to this endpoint. reset clears this bit. 1 = embedded device endpoint 1 is enabled and can respond to an in token 0 = embedded device endpoint 1 is disabled dstall2 ?embedded device endpoint 2 force stall bit this read/write bit causes embedded device endpoint 2 to return a stall handshake when polled by either an in or out token by the usb host controller. reset clears this bit. 1 = send stall handshake 0 = default address: $0047 bit 7 654321 bit 0 read: 0 0 0 0 enable2 enable1 dstall2 dstall1 write: reset: 00000000 = unimplemented figure 9-18. usb embedded device control register 2 (dcr2)
universal serial bus module (usb) i/o register description of the embedded device function mc68hc(7)08kh12 ? rev. 1.0 advance information motorola universal serial bus module (usb) 147 dstall1 ?embedded device endpoint 1 force stall bit this read/write bit causes embedded device endpoint 1 to return a stall handshake when polled by either an in or out token by the usb host controller. reset clears this bit. 1 = send stall handshake 0 = default 9.5.8 usb embedded device endpoint 0 data registers (de0d0-de0d7) de0rx7-de0rx0 ?embedded device endpoint 0 receive data buffer these read only bits are serially loaded with out token or setup token data directed at embedded device endpoint 0. the data is received over the usb? d0+ and d0?pins. de0tx7-de0tx0 ?embedded device endpoint 0 transmit data buffer these write only buffers are loaded by software with data to be sent on the usb bus on the next in token directed at embedded device endpoint 0. address: $0020 bit 7 654321 bit 0 read: de0r07 de0r06 de0r05 de0r04 de0r03 de0r02 de0r01 de0r00 write: de0t07 de0t06 de0t05 de0t04 de0t03 de0t02 de0t01 de0t00 reset: xxxxxxxx address: $0027 read: de0r77 de0r76 de0r75 de0r74 de0r73 de0r72 de0r71 de0r70 write: de0t77 de0t76 de0t75 de0t74 de0t73 de0t72 de0t71 de0t70 reset: xxxxxxxx x = indeterminate figure 9-19. usb embedded device endpoint 0 data register (ue0d0-ue0d7)
universal serial bus module (usb) advance information mc68hc(7)08kh12 ? rev. 1.0 148 universal serial bus module (usb) motorola 9.5.9 usb embedded device endpoint 1/2 data registers (de1d0-de1d7) de1td7-de1td0 ?embedded device endpoint 1/ endpoint 2 transmit data buffer these write only buffers are loaded by software with data to be sent on the usb bus on the next in token directed at endpoint 1 or endpoint 2 of the embedded device. these buffers are shared by embedded device endpoints 1 and 2 and depend on proper configuration of the endadd bit. address: $0028 bit 7 654321 bit 0 read: write: de1t07 de1t06 de1t05 de1t04 de1t03 de1t02 de1t01 de1t00 reset: xxxxxxxx address: $002f read: write: de1t77 de1t76 de1t75 de1t74 de1t73 de1t72 de1t71 de1t70 reset: xxxxxxxx = unimplemented x = indeterminate figure 9-20. usb embedded device endpoint 0 data register (ue0d0-ue0d7)
mc68hc(7)08kh12 ? rev. 1.0 advance information motorola monitor rom (mon) 149 advance information ?mc68hc(7)08kh12 section 10. monitor rom (mon) 10.1 contents 10.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149 10.3 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150 10.4 functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150 10.4.1 entering monitor mode . . . . . . . . . . . . . . . . . . . . . . . . . . . 152 10.4.2 data format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154 10.4.3 echoing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154 10.4.4 break signal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155 10.4.5 commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155 10.4.6 baud rate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159 10.2 introduction this section describes the monitor rom. the monitor rom allows complete testing of the mcu through a single-wire interface with a host computer.
monitor rom (mon) advance information mc68hc(7)08kh12 ? rev. 1.0 150 monitor rom (mon) motorola 10.3 features features of the monitor rom include the following: normal user-mode pin functionality one pin dedicated to serial communication between monitor rom and host computer standard mark/space non-return-to-zero (nrz) communication with host computer 4800 baud to 28.8 kbaud communication with host computer execution of code in ram or rom otprom programming 10.4 functional description the monitor rom receives and executes commands from a host computer. figure 10-1 shows a sample circuit used to enter monitor mode and communicate with a host computer via a standard rs-232 interface. simple monitor commands can access any memory address. in monitor mode, the mcu can execute host-computer code in ram while all mcu pins retain normal operating mode functions. all communication between the host computer and the mcu is through the pta0 pin. a level-shifting and multiplexing interface is required between pta0 and the host computer. pta0 is used in a wired-or configuration and requires a pull-up resistor.
monitor rom (mon) functional description mc68hc(7)08kh12 ? rev. 1.0 advance information motorola monitor rom (mon) 151 figure 10-1. monitor mode circuit + + + + 10 m w x1 v dd v dd + v hi mc145407 mc74hc125 68hc708 rst irq1 /v pp osc1 osc2 v ss2 v ssa v dd 1 pa0 v dd 10 k w 0.1 m f 10 w 6 5 2 4 3 1 db-25 2 3 7 20 18 17 19 16 15 v dd v dd v dd 20 pf 20 pf 10 m f 10 m f 10 m f 10 m f 1 2 4 7 14 3 0.1 m f 4.9152 mhz 10 k w pc3 v dd 10 k w b a notes: position a ?bus clock = cgmxclk ? 4 position b ?bus clock = cgmxclk ? 2 (see note.) 5 6 v ss1 pc0 pc1 v dd 10k w v dda 0.1 m f v dd pa7 v dd 2
monitor rom (mon) advance information mc68hc(7)08kh12 ? rev. 1.0 152 monitor rom (mon) motorola 10.4.1 entering monitor mode table 10-1 shows the pin conditions for entering monitor mode. if ptc3 is low upon monitor mode entry, cgmout is equal to the crystal frequency. the bus frequency in this case is a divide-by-two of the input clock. if ptc3 is high upon monitor mode entry, the bus frequency will be a divide-by-four of the input clock. note: holding the ptc3 pin low when entering monitor mode causes a bypass of a divide-by-two stage at the oscillator. the cgmout frequency is equal to the cgmxclk frequency, and the osc1 input directly generates internal bus clocks. in this case, the osc1 signal must have a 50% duty cycle at maximum bus frequency. enter monitor mode with the pin configuration shown above by pulling rst low and then high. the rising edge of rst latches monitor mode. once monitor mode is latched, the values on the specified pins can change. once out of reset, the mcu monitor mode firmware then sends a break signal (10 consecutive logic zeros) to the host computer, indicating that it is ready to receive a command. the break signal also provides a timing reference to allow the host to determine the necessary baud rate. monitor mode uses different vectors for reset, swi, and break interrupt. the alternate vectors are in the $fe page instead of the $ff page and allow code execution from the internal monitor firmware instead of user code. table 10-1. mode selection irq1 /v pp pin pc0 pin pc1 pin pa0 pin pc3 pin mode cgmout bus frequency v dd + v hi 1011 monitor cgmxclk ?2 cgmout ?2 v dd + v hi 1010 monitor cgmxclk cgmout ?2
monitor rom (mon) functional description mc68hc(7)08kh12 ? rev. 1.0 advance information motorola monitor rom (mon) 153 when the host computer has completed downloading code into the mcu ram, this code can be executed by driving pta0 low while asserting rst low and then high. the internal monitor rom firmware will interpret the low on pta0 as an indication to jump to ram, and execution control will then continue from ram. execution of an swi from the downloaded code will return program control to the internal monitor rom firmware. alternatively, the host can send a run command, which executes an rti, and this can be used to send control to the address on the stack pointer. the cop module is disabled in monitor mode as long as v dd + v hi is applied to either the irq1 /v pp pin or the rst pin. ( see section 7. system integration module (sim) for more information on modes of operation.) table 10-2 is a summary of the differences between user mode and monitor mode. table 10-2. mode differences modes functions cop reset vector high reset vector low break vector high break vector low swi vector high swi vector low user enabled $fffe $ffff $fffc $fffd $fffc $fffd monitor disabled (1) 1. if the high voltage (v dd + v hi ) is removed from the irq1 /v pp pin or the rst pin, the sim asserts its cop enable output. the cop is a mask option enabled or disabled by the copd bit in the configuration register. $fefe $feff $fefc $fefd $fefc $fefd
monitor rom (mon) advance information mc68hc(7)08kh12 ? rev. 1.0 154 monitor rom (mon) motorola 10.4.2 data format communication with the monitor rom is in standard non-return-to-zero (nrz) mark/space data format. (see figure 10-2 and figure 10-3 .) figure 10-2. monitor data format figure 10-3. sample monitor waveforms the data transmit and receive rate can be anywhere from 4800 baud to 28.8 kbaud. transmit and receive baud rates must be identical. 10.4.3 echoing as shown in figure 10-4 , the monitor rom immediately echoes each received byte back to the pta0 pin for error checking. figure 10-4. read transaction any result of a command appears after the echo of the last byte of the command. bit 5 start bit bit 0 bit 1 next stop bit start bit bit 2 bit 3 bit 4 bit 6 bit 7 bit 5 start bit bit 0 bit 1 next stop bit start bit bit 2 bit 3 bit 4 bit 6 bit 7 start bit bit 0 bit 1 next stop bit start bit bit 2 $a5 break bit 3 bit 4 bit 5 bit 6 bit 7 addr. high read read addr. high addr. low addr. low data echo sent to monitor result
monitor rom (mon) functional description mc68hc(7)08kh12 ? rev. 1.0 advance information motorola monitor rom (mon) 155 10.4.4 break signal a start bit followed by nine low bits is a break signal. (see figure 10-5.) when the monitor receives a break signal, it drives the pta0 pin high for the duration of two bits before echoing the break signal. figure 10-5. break transaction 10.4.5 commands the monitor rom uses the following commands: read (read memory) write (write memory) iread (indexed read) iwrite (indexed write) readsp (read stack pointer) run (run user program) 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 missing stop bit two-stop-bit delay before zero echo
monitor rom (mon) advance information mc68hc(7)08kh12 ? rev. 1.0 156 monitor rom (mon) motorola table 10-3. read (read memory) command description read byte from memory operand speci?s 2-byte address in high byte:low byte order data returned returns contents of speci?d address opcode $4a command sequence addr. high read read addr. high addr. low addr. low data echo sent to monitor result table 10-4. write (write memory) command description write byte to memory operand speci?s 2-byte address in high byte:low byte order; low byte followed by data byte data returned none opcode $49 command sequence addr. high write write addr. high addr. low addr. low data echo sent to monitor data
monitor rom (mon) functional description mc68hc(7)08kh12 ? rev. 1.0 advance information motorola monitor rom (mon) 157 table 10-5. iread (indexed read) command description read next 2 bytes in memory from last address accessed operand speci?s 2-byte address in high byte:low byte order data returned returns contents of next two addresses opcode $1a command sequence data iread iread data echo sent to monitor result table 10-6. iwrite (indexed write) command description write to last address accessed + 1 operand speci?s single data byte data returned none opcode $19 command sequence data iwrite iwrite data echo sent to monitor
monitor rom (mon) advance information mc68hc(7)08kh12 ? rev. 1.0 158 monitor rom (mon) motorola note: a sequence of iread or iwrite commands can sequentially access a block of memory over the full 64-kbyte memory map. table 10-7. readsp (read stack pointer) command description reads stack pointer operand none data returned returns stack pointer in high byte:low byte order opcode $0c command sequence table 10-8. run (run user program) command description executes rti instruction operand none data returned none opcode $28 command sequence sp high readsp readsp sp low echo sent to monitor result run run echo sent to monitor
monitor rom (mon) functional description mc68hc(7)08kh12 ? rev. 1.0 advance information motorola monitor rom (mon) 159 10.4.6 baud rate the communication baud rate is controlled by crystal frequency and the state of the ptc3 pin upon entry into monitor mode. when ptc3 is high, the divide by ratio is 1024. if the ptc3 pin is at logic zero upon entry into monitor mode, the divide by ratio is 512. table 10-9. monitor baud rate selection crystal frequency (mhz) ptc3 pin baud rate 4.9152mhz 0 9600 bps 4.9152mhz 1 4800 bps
monitor rom (mon) advance information mc68hc(7)08kh12 ? rev. 1.0 160 monitor rom (mon) motorola
mc68hc(7)08kh12 ? rev. 1.0 advance information motorola timer interface module (tim) 161 advance information ?mc68hc(7)08kh12 section 11. timer interface module (tim) 11.1 contents 11.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162 11.3 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162 11.4 functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163 11.4.1 tim counter prescaler . . . . . . . . . . . . . . . . . . . . . . . . . . . 165 11.4.2 input capture. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165 11.4.3 output compare . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165 11.4.3.1 unbuffered output compare . . . . . . . . . . . . . . . . . . . . . 166 11.4.3.2 buffered output compare . . . . . . . . . . . . . . . . . . . . . . . 166 11.4.4 pulse width modulation (pwm) . . . . . . . . . . . . . . . . . . . . 167 11.4.4.1 unbuffered pwm signal generation . . . . . . . . . . . . . . . 168 11.4.4.2 buffered pwm signal generation . . . . . . . . . . . . . . . . . 169 11.4.4.3 pwm initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170 11.5 interrupts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171 11.6 wait mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171 11.7 tim during break interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . 172 11.8 i/o signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172 11.8.1 tim clock pin (pte0/tclk) . . . . . . . . . . . . . . . . . . . . . . . 172 11.8.2 tim channel i/o pins (pte1/tch0:pte2/tch1). . . . . . . 173 11.9 i/o registers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173 11.9.1 tim status and control register (tsc) . . . . . . . . . . . . . . 173 11.9.2 tim counter registers (tcnth:tcntl) . . . . . . . . . . . . . 175 11.9.3 tim counter modulo registers (tmodh:tmodl) . . . . . . 176 11.9.4 tim channel status and control registers (tsc0:tsc1) 177 11.9.5 tim channel registers (tch0h/l?ch1h/l) . . . . . . . . . 181
timer interface module (tim) advance information mc68hc(7)08kh12 ? rev. 1.0 162 timer interface module (tim) motorola 11.2 introduction this section describes the timer interface module (tim2, version b). the tim is a two-channel timer that provides a timing reference with input capture, output compare, and pulse-width-modulation functions. figure 11-1 is a block diagram of the tim. 11.3 features features of the tim include the following: two input capture/output compare channels rising-edge, falling-edge, or any-edge input capture trigger set, clear, or toggle output compare action buffered and unbuffered pulse width modulation (pwm) signal generation programmable tim clock input seven-frequency internal bus clock prescaler selection external tim clock input (4-mhz maximum frequency) free-running or modulo up-count operation toggle any channel pin on overflow tim counter stop and reset bits modular architecture expandable to eight channels
timer interface module (tim) functional description mc68hc(7)08kh12 ? rev. 1.0 advance information motorola timer interface module (tim) 163 11.4 functional description figure 11-1 shows the structure of the tim. the central component of the tim is the 16-bit tim counter that can operate as a free-running counter or a modulo up-counter. the tim counter provides the timing reference for the input capture and output compare functions. the tim counter modulo registers, tmodh:tmodl, control the modulo value of the tim counter. software can read the tim counter value at any time without affecting the counting sequence. the two tim channels are programmable independently as input capture or output compare channels. figure 11-1. tim block diagram prescaler prescaler select 16-bit comparator ps2 ps1 ps0 16-bit comparator 16-bit latch tch0h:tch0l ms0a els0b els0a tof toie 16-bit comparator 16-bit latch tch1h:tch1l channel 0 channel 1 tmodh:tmodl trst tstop tov0 ch0ie ch0f els1b els1a tov1 ch1ie ch1max ch1f ch0max ms0b 16-bit counter internal bus ms1a tclk pte0/tclk internal bus clock pte2/tch1 pte1/tch0 interrupt logic pte2 logic interrupt logic interrupt logic pte1 logic
timer interface module (tim) advance information mc68hc(7)08kh12 ? rev. 1.0 164 timer interface module (tim) motorola table 11-1. tim i/o register summary addr. register name bit 7 654321 bit 0 $0010 tim status/control register (tsc) read: tof toie tstop 00 ps2 ps1 ps0 write: 0 trst reset: 00100000 $0012 tim counter register high (tcnth) read: bit15 bit14 bit13 bit12 bit11 bit10 bit9 bit8 write: reset: 00000000 $0013 tim counter register low (tcntl) read: bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 write: reset: 00000000 $0014 tim counter modulo register high (tmodh) read: bit15 bit14 bit13 bit12 bit11 bit10 bit9 bit8 write: reset: 11111111 $0015 tim counter modulo register low (tmodl) read: bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 write: reset: 11111111 $0016 tim channel 0 status/control register (tsc0) read: ch0f ch0ie ms0b ms0a els0b els0a tov0 ch0max write: 0 reset: 00000000 $0017 tim channel 0 register high (tch0h) read: bit15 bit14 bit13 bit12 bit11 bit10 bit9 bit8 write: reset: xxxxxxxx $0018 tim channel 0 register low (tch0l) read: bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 write: reset: xxxxxxxx $0019 tim channel 1 status/control register (tsc1) read: ch1f ch1ie 0 ms1a els1b els1a tov1 ch1max write: 0 reset: 00000000
timer interface module (tim) functional description mc68hc(7)08kh12 ? rev. 1.0 advance information motorola timer interface module (tim) 165 11.4.1 tim counter prescaler the tim clock source can be one of the seven prescaler outputs or the tim clock pin, pte0/tclk. the prescaler generates seven clock rates from the internal bus clock. the prescaler select bits, ps[2:0], in the tim status and control register (tsc) select the tim clock source. 11.4.2 input capture with the input capture function, the tim can capture the time at which an external event occurs. when an active edge occurs on the pin of an input capture channel, the tim latches the contents of the tim counter into the tim channel registers, tchxh:tchxl. the polarity of the active edge is programmable. input captures can generate tim cpu interrupt requests. 11.4.3 output compare with the output compare function, the tim can generate a periodic pulse with a programmable polarity, duration, and frequency. when the counter reaches the value in the registers of an output compare channel, the tim can set, clear, or toggle the channel pin. output compares can generate tim cpu interrupt requests. $001a tim channel 1 register high (tch1h) read: bit15 bit14 bit13 bit12 bit11 bit10 bit9 bit8 write: reset: xxxxxxxx $001b tim channel 1 register low (tch1l) read: bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 write: reset: xxxxxxxx = unimplemented x = indeterminate
timer interface module (tim) advance information mc68hc(7)08kh12 ? rev. 1.0 166 timer interface module (tim) motorola 11.4.3.1 unbuffered output compare any output compare channel can generate unbuffered output compare pulses as described in 11.4.3 output compare . the pulses are unbuffered because changing the output compare value requires writing the new value over the old value currently in the tim channel registers. an unsynchronized write to the tim channel registers to change an output compare value could cause incorrect operation for up to two counter overflow periods. for example, writing a new value before the counter reaches the old value but after the counter reaches the new value prevents any compare during that counter overflow period. also, using a tim overflow interrupt routine to write a new, smaller output compare value may cause the compare to be missed. the tim may pass the new value before it is written. use the following methods to synchronize unbuffered changes in the output compare value on channel x: when changing to a smaller value, enable channel x output compare interrupts and write the new value in the output compare interrupt routine. the output compare interrupt occurs at the end of the current output compare pulse. the interrupt routine has until the end of the counter overflow period to write the new value. when changing to a larger output compare value, enable channel x tim overflow interrupts and write the new value in the tim overflow interrupt routine. the tim overflow interrupt occurs at the end of the current counter overflow period. writing a larger value in an output compare interrupt routine (at the end of the current pulse) could cause two output compares to occur in the same counter overflow period. 11.4.3.2 buffered output compare channels 0 and 1 can be linked to form a buffered output compare channel whose output appears on the pte1/tch0 pin. the tim channel registers of the linked pair alternately control the output. setting the ms0b bit in tim channel 0 status and control register (tsc0) links channel 0 and channel 1. the output compare value in the tim
timer interface module (tim) functional description mc68hc(7)08kh12 ? rev. 1.0 advance information motorola timer interface module (tim) 167 channel 0 registers initially controls the output on the pte1/tch0 pin. writing to the tim channel 1 registers enables the tim channel 1 registers to synchronously control the output after the tim overflows. at each subsequent overflow, the tim channel registers (0 or 1) that control the output are the ones written to last. tsc0 controls and monitors the buffered output compare function, and tim channel 1 status and control register (tsc1) is unused. while the ms0b bit is set, the channel 1 pin, pte2/tch1, is available as a general-purpose i/o pin. note: in buffered output compare operation, do not write new output compare values to the currently active channel registers. writing to the active channel registers is the same as generating unbuffered output compares. 11.4.4 pulse width modulation (pwm) by using the toggle-on-overflow feature with an output compare channel, the tim can generate a pwm signal. the value in the tim counter modulo registers determines the period of the pwm signal. the channel pin toggles when the counter reaches the value in the tim counter modulo registers. the time between overflows is the period of the pwm signal. as figure 11-2 shows, the output compare value in the tim channel registers determines the pulse width of the pwm signal. the time between overflow and output compare is the pulse width. program the tim to clear the channel pin on output compare if the state of the pwm pulse is logic one. program the tim to set the pin if the state of the pwm pulse is logic zero.
timer interface module (tim) advance information mc68hc(7)08kh12 ? rev. 1.0 168 timer interface module (tim) motorola figure 11-2. pwm period and pulse width the value in the tim counter modulo registers and the selected prescaler output determines the frequency of the pwm output. the frequency of an 8-bit pwm signal is variable in 256 increments. writing $00ff (255) to the tim counter modulo registers produces a pwm period of 256 times the internal bus clock period if the prescaler select value is 000 (see 11.9.1 tim status and control register (tsc) ). the value in the tim channel registers determines the pulse width of the pwm output. the pulse width of an 8-bit pwm signal is variable in 256 increments. writing $0080 (128) to the tim channel registers produces a duty cycle of 128/256 or 50%. 11.4.4.1 unbuffered pwm signal generation any output compare channel can generate unbuffered pwm pulses as described in 11.4.4 pulse width modulation (pwm) . the pulses are unbuffered because changing the pulse width requires writing the new pulse width value over the old value currently in the tim channel registers. an unsynchronized write to the tim channel registers to change a pulse width value could cause incorrect operation for up to two pwm periods. for example, writing a new value before the counter reaches the old value but after the counter reaches the new value prevents any compare during that pwm period. also, using a tim overflow interrupt routine to ptex/tchxa period pulse width overflow overflow overflow output compare output compare output compare
timer interface module (tim) functional description mc68hc(7)08kh12 ? rev. 1.0 advance information motorola timer interface module (tim) 169 write a new, smaller pulse width value may cause the compare to be missed. the tim may pass the new value before it is written. use the following methods to synchronize unbuffered changes in the pwm pulse width on channel x: when changing to a shorter pulse width, enable channel x output compare interrupts and write the new value in the output compare interrupt routine. the output compare interrupt occurs at the end of the current pulse. the interrupt routine has until the end of the pwm period to write the new value. when changing to a longer pulse width, enable channel x tim overflow interrupts and write the new value in the tim overflow interrupt routine. the tim overflow interrupt occurs at the end of the current pwm period. writing a larger value in an output compare interrupt routine (at the end of the current pulse) could cause two output compares to occur in the same pwm period. note: in pwm signal generation, do not program the pwm channel to toggle on output compare. toggling on output compare prevents reliable 0% duty cycle generation and removes the ability of the channel to self-correct in the event of software error or noise. toggling on output compare also can cause incorrect pwm signal generation when changing the pwm pulse width to a new, much larger value. 11.4.4.2 buffered pwm signal generation channels 0 and 1 can be linked to form a buffered pwm channel whose output appears on the pte1/tch0 pin. the tim channel registers of the linked pair alternately control the pulse width of the output. setting the ms0b bit in tim channel 0 status and control register (tsc0) links channel 0 and channel 1. the tim channel 0 registers initially control the pulse width on the pte1/tch0 pin. writing to the tim channel 1 registers enables the tim channel 1 registers to synchronously control the pulse width at the beginning of the next pwm period. at each subsequent overflow, the tim channel registers (0 or 1) that control the pulse width are the ones written to last. tsc0 controls and monitors the buffered pwm function, and tim channel 1 status and
timer interface module (tim) advance information mc68hc(7)08kh12 ? rev. 1.0 170 timer interface module (tim) motorola control register (tsc1) is unused. while the ms0b bit is set, the channel 1 pin, pte2/tch1, is available as a general-purpose i/o pin. note: in buffered pwm signal generation, do not write new pulse width values to the currently active channel registers. writing to the active channel registers is the same as generating unbuffered pwm signals. 11.4.4.3 pwm initialization to ensure correct operation when generating unbuffered or buffered pwm signals, use the following initialization procedure: 1. in the tim status and control register (tsc): a. stop the tim counter by setting the tim stop bit, tstop. b. reset the tim counter by setting the tim reset bit, trst. 2. in the tim counter modulo registers (tmodh:tmodl), write the value for the required pwm period. 3. in the tim channel x registers (tchxh:tchxl), write the value for the required pulse width. 4. in tim channel x status and control register (tscx): a. write 0:1 (for unbuffered output compare or pwm signals) or 1:0 (for buffered output compare or pwm signals) to the mode select bits, msxb:msxa. (see table 11-3.) b. write 1 to the toggle-on-overflow bit, tovx. c. write 1:0 (to clear output on compare) or 1:1 (to set output on compare) to the edge/level select bits, elsxb:elsxa. the output action on compare must force the output to the complement of the pulse width level. (see table 11-3 .) note: in pwm signal generation, do not program the pwm channel to toggle on output compare. toggling on output compare prevents reliable 0% duty cycle generation and removes the ability of the channel to self-correct in the event of software error or noise. toggling on output compare can also cause incorrect pwm signal generation when changing the pwm pulse width to a new, much larger value. 5. in the tim status control register (tsc), clear the tim stop bit, tstop.
timer interface module (tim) interrupts mc68hc(7)08kh12 ? rev. 1.0 advance information motorola timer interface module (tim) 171 setting ms0b links channels 0 and 1 and configures them for buffered pwm operation. the tim channel 0 registers (tch0h:tch0l) initially control the buffered pwm output. tim status control register 0 (tscr0) controls and monitors the pwm signal from the linked channels. ms0b takes priority over ms0a. clearing the toggle-on-overflow bit, tovx, inhibits output toggles on tim overflows. subsequent output compares try to force the output to a state it is already in and have no effect. the result is a 0% duty cycle output. setting the channel x maximum duty cycle bit (chxmax) and clearing the tovx bit generates a 100% duty cycle output. see 11.9.4 tim channel status and control registers (tsc0:tsc1) . 11.5 interrupts the following tim sources can generate interrupt requests: tim overflow flag (tof) ?the tof bit is set when the tim counter value rolls over to $0000 after matching the value in the tim counter modulo registers. the tim overflow interrupt enable bit, toie, enables tim overflow cpu interrupt requests. tof and toie are in the tim status and control register. tim channel flags (ch1f:ch0f) ?the chxf bit is set when an input capture or output compare occurs on channel x. channel x tim cpu interrupt requests are controlled by the channel x interrupt enable bit, chxie. channel x tim cpu interrupt requests are enabled when chxie=1. chxf and chxie are in the tim channel x status and control register. 11.6 wait mode the wait instruction puts the mcu in low-power-consumption standby mode. the tim remains active after the execution of a wait instruction. in wait mode the tim registers are not accessible by the cpu. any enabled cpu interrupt request from the tim can bring the mcu out of wait mode.
timer interface module (tim) advance information mc68hc(7)08kh12 ? rev. 1.0 172 timer interface module (tim) motorola if tim functions are not required during wait mode, reduce power consumption by stopping the tim before executing the wait instruction. 11.7 tim during break interrupts a break interrupt stops the tim counter. the system integration module (sim) controls whether status bits in other modules can be cleared during the break state. the bcfe bit in the break flag control register (bfcr) enables software to clear status bits during the break state. (see 7.8.3 break flag control register (bfcr) .) to allow software to clear status bits during a break interrupt, write a logic one to the bcfe bit. if a status bit is cleared during the break state, it remains cleared when the mcu exits the break state. to protect status bits during the break state, write a logic zero to the bcfe bit. with bcfe at logic zero (its default state), software can read and write i/o registers during the break state without affecting status bits. some status bits have a two-step read/write clearing procedure. if software does the first step on such a bit before the break, the bit cannot change during the break state as long as bcfe is at logic zero. after the break, doing the second step clears the status bit. 11.8 i/o signals port e shares three of its pins with the tim. pte0/tclk is and external clock input to the tim prescaler. the two tim channel i/o pins are pte1/tch0 and pte2/tch1. 11.8.1 tim clock pin (pte0/tclk) pte0/tclk is an external clock input that can be the clock source for the tim counter instead of the prescaled internal bus clock. select the pte0/tclk input by writing logic ones to the three prescaler select bits, ps[2:0]. (see 11.9.1 tim status and control register (tsc) .) the
timer interface module (tim) i/o registers mc68hc(7)08kh12 ? rev. 1.0 advance information motorola timer interface module (tim) 173 minimum tclk pulse width, tclk lmin or tclk hmin , is: the maximum tclk frequency is: pte0/tclk is available as a general-purpose i/o pin when not used as the tim clock input. when the pte0/tclk pin is the tim clock input, it is an input regardless of the state of the ddre0 bit in data direction register e. 11.8.2 tim channel i/o pins (pte1/tch0:pte2/tch1) each channel i/o pin is programmable independently as an input capture pin or an output compare pin. pte1/tch0 can be configured as buffered output compare or buffered pwm pins. 11.9 i/o registers the following i/o registers control and monitor operation of the tim: tim status and control register (tsc) tim control registers (tcnth:tcntl) tim counter modulo registers (tmodh:tmodl) tim channel status and control registers (tsc0 and tsc1) tim channel registers (tch0h:tch0l and tch1h:tch1l) 11.9.1 tim status and control register (tsc) the tim status and control register does the following: enables tim overflow interrupts flags tim overflows stops the tim counter 1 bus frequency ------------------------------------- t su + bus frequency 2 -------------------------------------
timer interface module (tim) advance information mc68hc(7)08kh12 ? rev. 1.0 174 timer interface module (tim) motorola resets the tim counter prescales the tim counter clock tof ?tim overflow flag bit this read/write flag is set when the tim counter resets to $0000 after reaching the modulo value programmed in the tim counter modulo registers. clear tof by reading the tim status and control register when tof is set and then writing a logic zero to tof. if another tim overflow occurs before the clearing sequence is complete, then writing logic zero to tof has no effect. therefore, a tof interrupt request cannot be lost due to inadvertent clearing of tof. reset clears the tof bit. writing a logic one to tof has no effect. 1 = tim counter has reached modulo value 0 = tim counter has not reached modulo value toie ?tim overflow interrupt enable bit this read/write bit enables tim overflow interrupts when the tof bit becomes set. reset clears the toie bit. 1 = tim overflow interrupts enabled 0 = tim overflow interrupts disabled tstop ?tim stop bit this read/write bit stops the tim counter. counting resumes when tstop is cleared. reset sets the tstop bit, stopping the tim counter until software clears the tstop bit. 1 = tim counter stopped 0 = tim counter active address: $0010 bit 7 654321 bit 0 read: tof toie tstop 00 ps2 ps1 ps0 write: 0 trst reset: 00100000 = unimplemented figure 11-3. tim status and control register (tsc)
timer interface module (tim) i/o registers mc68hc(7)08kh12 ? rev. 1.0 advance information motorola timer interface module (tim) 175 note: do not set the tstop bit before entering wait mode if the tim is required to exit wait mode. trst ?tim reset bit setting this write-only bit resets the tim counter and the tim prescaler. setting trst has no effect on any other registers. counting resumes from $0000. trst is cleared automatically after the tim counter is reset and always reads as logic zero. reset clears the trst bit. 1 = prescaler and tim counter cleared 0 = no effect note: setting the tstop and trst bits simultaneously stops the tim counter at a value of $0000. ps[2:0] ?prescaler select bits these read/write bits select either the pte0/tclk pin or one of the seven prescaler outputs as the input to the tim counter as table 11-2 shows. reset clears the ps[2:0] bits. 11.9.2 tim counter registers (tcnth:tcntl) the two read-only tim counter registers contain the high and low bytes of the value in the tim counter. reading the high byte (tcnth) latches the contents of the low byte (tcntl) into a buffer. subsequent reads of table 11-2. prescaler selection ps2 ps1 ps0 tim clock source 0 0 0 internal bus clock ?1 0 0 1 internal bus clock ?2 0 1 0 internal bus clock ?4 0 1 1 internal bus clock ?8 1 0 0 internal bus clock ?16 1 0 1 internal bus clock ?32 1 1 0 internal bus clock ?64 1 1 1 pte0/tclk
timer interface module (tim) advance information mc68hc(7)08kh12 ? rev. 1.0 176 timer interface module (tim) motorola tcnth do not affect the latched tcntl value until tcntl is read. reset clears the tim counter registers. setting the tim reset bit (trst) also clears the tim counter registers. note: if you read tcnth during a break interrupt, be sure to unlatch tcntl by reading tcntl before exiting the break interrupt. otherwise, tcntl retains the value latched during the break. 11.9.3 tim counter modulo registers (tmodh:tmodl) the read/write tim modulo registers contain the modulo value for the tim counter. when the tim counter reaches the modulo value, the overflow flag (tof) becomes set, and the tim counter resumes counting from $0000 at the next clock. writing to the high byte (tmodh) inhibits the tof bit and overflow interrupts until the low byte (tmodl) is written. reset sets the tim counter modulo registers. address: $0012 tcnth bit 7 654321 bit 0 read: bit15 bit14 bit13 bit12 bit11 bit10 bit9 bit8 write: reset: 00000000 address: $0013 tcntl bit 7 654321 bit 0 read: bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 write: reset: 00000000 = unimplemented figure 11-4. tim counter registers (tcnth:tcntl)
timer interface module (tim) i/o registers mc68hc(7)08kh12 ? rev. 1.0 advance information motorola timer interface module (tim) 177 note: reset the tim counter before writing to the tim counter modulo registers. 11.9.4 tim channel status and control registers (tsc0:tsc1) each of the tim channel status and control registers does the following: flags input captures and output compares enables input capture and output compare interrupts selects input capture, output compare, or pwm operation selects high, low, or toggling output on output compare selects rising edge, falling edge, or any edge as the active input capture trigger selects output toggling on tim overflow selects 100% pwm duty cycle selects buffered or unbuffered output compare/pwm operation address: $0014 tmodh bit 7 654321 bit 0 read: bit15 bit14 bit13 bit12 bit11 bit10 bit9 bit8 write: reset: 11111111 address: $0015 tmodl bit 7 654321 bit 0 read: bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 write: reset: 11111111 figure 11-5. tim counter modulo registers (tmodh:tmodl)
timer interface module (tim) advance information mc68hc(7)08kh12 ? rev. 1.0 178 timer interface module (tim) motorola chxf ?channel x flag bit when channel x is an input capture channel, this read/write bit is set when an active edge occurs on the channel x pin. when channel x is an output compare channel, chxf is set when the value in the tim counter registers matches the value in the tim channel x registers. when tim cpu interrupt requests are enabled (chxie=1), clear chxf by reading the tim channel x status and control register with chxf set and then writing a logic zero to chxf. if another interrupt request occurs before the clearing sequence is complete, then writing logic zero to chxf has no effect. therefore, an interrupt request cannot be lost due to inadvertent clearing of chxf. reset clears the chxf bit. writing a logic one to chxf has no effect. 1 = input capture or output compare on channel x 0 = no input capture or output compare on channel x chxie ?channel x interrupt enable bit this read/write bit enables tim cpu interrupt service requests on channel x. reset clears the chxie bit. 1 = channel x cpu interrupt requests enabled 0 = channel x cpu interrupt requests disabled address: $0016 tsc0 bit 7 654321 bit 0 read: ch0f ch0ie ms0b ms0a els0b els0a tov0 ch0max write: 0 reset: 00000000 address: $0019 tsc1 bit 7 654321 bit 0 read: ch1f ch1ie 0 ms1a els1b els1a tov1 ch1max write: 0 reset: 00000000 = unimplemented figure 11-6. tim channel status and control registers (tsc0:tsc1)
timer interface module (tim) i/o registers mc68hc(7)08kh12 ? rev. 1.0 advance information motorola timer interface module (tim) 179 msxb ?mode select bit b this read/write bit selects buffered output compare/pwm operation. msxb exists only in the tim channel 0 status and control register. setting ms0b disables the channel 1 status and control register and reverts tch1 to general-purpose i/o. reset clears the msxb bit. 1 = buffered output compare/pwm operation enabled 0 = buffered output compare/pwm operation disabled msxa ?mode select bit a when elsxb:a 1 00, this read/write bit selects either input capture operation or unbuffered output compare/pwm operation. see table 11-3 . 1 = unbuffered output compare/pwm operation 0 = input capture operation when elsxb:a = 00, this read/write bit selects the initial output level of the tchx pin. (see table 11-3.) . reset clears the msxa bit. 1 = initial output level low 0 = initial output level high note: before changing a channel function by writing to the msxb or msxa bit, set the tstop and trst bits in the tim status and control register (tsc). elsxb and elsxa ?edge/level select bits when channel x is an input capture channel, these read/write bits control the active edge-sensing logic on channel x. when channel x is an output compare channel, elsxb and elsxa control the channel x output behavior when an output compare occurs. when elsxb and elsxa are both clear, channel x is not connected to port e, and pin ptex/tchx is available as a general-purpose i/o pin. table 11-3 shows how elsxb and elsxa work. reset clears the elsxb and elsxa bits.
timer interface module (tim) advance information mc68hc(7)08kh12 ? rev. 1.0 180 timer interface module (tim) motorola note: before enabling a tim channel register for input capture operation, make sure that the ptex/tchx pin is stable for at least two bus clocks. tovx ?toggle-on-overflow bit when channel x is an output compare channel, this read/write bit controls the behavior of the channel x output when the tim counter overflows. when channel x is an input capture channel, tovx has no effect. reset clears the tovx bit. 1 = channel x pin toggles on tim counter overflow. 0 = channel x pin does not toggle on tim counter overflow. note: when tovx is set, a tim counter overflow takes precedence over a channel x output compare if both occur at the same time. chxmax ?channel x maximum duty cycle bit when the tovx bit is at logic zero, setting the chxmax bit forces the duty cycle of buffered and unbuffered pwm signals to 100%. as figure 11-7 shows, the chxmax bit takes effect in the cycle after it is set or cleared. the output stays at the 100% duty cycle level until the cycle after chxmax is cleared. table 11-3. mode, edge, and level selection msxb msxa elsxb elsxa mode configuration x0 0 0 output preset pin under port control; initial output level high x1 0 0 pin under port control; initial output level low 00 0 1 input capture capture on rising edge only 0 0 1 0 capture on falling edge only 0 0 1 1 capture on rising or falling edge 01 0 1 output compare or pwm toggle output on compare 0 1 1 0 clear output on compare 0 1 1 1 set output on compare 1 x 0 1 buffered output compare or buffered pwm toggle output on compare 1 x 1 0 clear output on compare 1 x 1 1 set output on compare
timer interface module (tim) i/o registers mc68hc(7)08kh12 ? rev. 1.0 advance information motorola timer interface module (tim) 181 figure 11-7. chxmax latency 11.9.5 tim channel registers (tch0h/l?ch1h/l) these read/write registers contain the captured tim counter value of the input capture function or the output compare value of the output compare function. the state of the tim channel registers after reset is unknown. in input capture mode (msxb:msxa = 0:0), reading the high byte of the tim channel x registers (tchxh) inhibits input captures until the low byte (tchxl) is read. in output compare mode (msxb:msxa 1 0:0), writing to the high byte of the tim channel x registers (tchxh) inhibits output compares until the low byte (tchxl) is written. output overflow ptex/tchx period chxmax overflow overflow overflow overflow compare output compare output compare output compare
timer interface module (tim) advance information mc68hc(7)08kh12 ? rev. 1.0 182 timer interface module (tim) motorola address: $0017 tch0h bit 7 654321 bit 0 read: bit15 bit14 bit13 bit12 bit11 bit10 bit9 bit8 write: reset: indeterminate after reset address: $0018 tch0l bit 7 654321 bit 0 read: bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 write: reset: indeterminate after reset address: $001a tch1h bit 7 654321 bit 0 read: bit15 bit14 bit13 bit12 bit11 bit10 bit9 bit8 write: reset: indeterminate after reset address: $001b tch1l bit 7 654321 bit 0 read: bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 write: reset: indeterminate after reset figure 11-8. tim channel registers (tch0h/l:tch1h/l)
mc68hc(7)08kh12 ? rev. 1.0 advance information motorola i/o ports 183 advance information ?mc68hc(7)08kh12 section 12. i/o ports 12.1 contents 12.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184 12.3 port a . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186 12.3.1 port a data register (pta) . . . . . . . . . . . . . . . . . . . . . . . . 186 12.3.2 data direction register a (ddra) . . . . . . . . . . . . . . . . . . 186 12.4 port b . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188 12.4.1 port b data register (ptb) . . . . . . . . . . . . . . . . . . . . . . . . 188 12.4.2 data direction register b (ddrb) . . . . . . . . . . . . . . . . . . 189 12.5 port c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190 12.5.1 port c data register (ptc). . . . . . . . . . . . . . . . . . . . . . . . 190 12.5.2 data direction register c (ddrc) . . . . . . . . . . . . . . . . . . 191 12.6 port d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192 12.6.1 port d data register (ptd). . . . . . . . . . . . . . . . . . . . . . . . 193 12.6.2 data direction register d (ddrd) . . . . . . . . . . . . . . . . . . 193 12.7 port e . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195 12.7.1 port e data register (pte) . . . . . . . . . . . . . . . . . . . . . . . . 195 12.7.2 data direction register e (ddre) . . . . . . . . . . . . . . . . . . 196 12.7.3 port-e optical interface enable register . . . . . . . . . . . . . 198 12.8 port f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202 12.8.1 port f data register (ptf) . . . . . . . . . . . . . . . . . . . . . . . . 202 12.8.2 data direction register f (ddrf). . . . . . . . . . . . . . . . . . . 203 12.9 port options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204 12.9.1 port option control register (poc) . . . . . . . . . . . . . . . . . 204
i/o ports advance information mc68hc(7)08kh12 ? rev. 1.0 184 i/o ports motorola 12.2 introduction forty-two bidirectional input-output (i/o) pins form five parallel ports. all i/o pins are programmable as inputs or outputs. note: connect any unused i/o pins to an appropriate logic level, either v dd or v ss . although the i/o ports do not require termination for proper operation, termination reduces excess current consumption and the possibility of electrostatic damage. table 12-1. i/o port register summary addr. register name bit 7 654321 bit 0 $0000 port a data register (pta) read: pta7 pta6 pta5 pta4 pta3 pta2 pta1 pta0 write: reset: unaffected by reset $0001 port b data register (ptb) read: ptb7 ptb6 ptb5 ptb4 ptb3 ptb2 ptb1 ptb0 write: reset: unaffected by reset $0002 port c data register (ptc) read: 0 0 0 ptc4 ptc3 ptc2 ptc1 ptc0 write: reset: unaffected by reset $0003 port d data register (ptd) read: ptd7 ptd6 ptd5 ptd4 ptd3 ptd2 ptd1 ptd0 write: reset: unaffected by reset $0004 data direction register a (ddra) read: ddra7 ddra6 ddra5 ddra4 ddra3 ddra2 ddra1 ddra0 write: reset: 00000000 $0005 data direction register b (ddrb) read: ddrb7 ddrb6 ddrb5 ddrb4 ddrb3 ddrb2 ddrb1 ddrb0 write: reset: 00000000 $0006 data direction register c (ddrc) read: 0 0 0 ddrc4 ddrc3 ddrc2 ddrc1 ddrc0 write: reset: 00000000
i/o ports introduction mc68hc(7)08kh12 ? rev. 1.0 advance information motorola i/o ports 185 $0007 data direction register d (ddrd) read: ddrd7 ddrd6 ddrd5 ddrd4 ddrd3 ddrd2 ddrd1 ddrd0 write: reset: 00000000 $0008 port e data register (pte) read: 0 0 0 pte4 pte3 pte2 pte1 pte0 write: reset: unaffected by reset $0009 port f data register (ptf) read: ptf7 ptf6 ptf5 ptf4 ptf3 ptf2 ptf1 ptf0 write: reset: unaffected by reset $000a data direction register e (ddre) read: 0 0 0 ddre4 ddre3 ddre2 ddre1 ddre0 write: reset: 00000000 $000b data direction register f (ddrf) read: ddrf7 ddrf6 ddrf5 ddrf4 ddrf3 ddrf2 ddrf1 ddrf0 write: reset: 00000000 $001c port e optical interface enable register (eoier) read: yref2 yref1 yref0 xref2 xref1 xref0 oiey oiex write: reset: 01001000 $001d port option control register (poc) read: 0 0 ldd 00 pcp pbp pap write: reset: 00100000 = unimplemented
i/o ports advance information mc68hc(7)08kh12 ? rev. 1.0 186 i/o ports motorola 12.3 port a port a is an 8-bit general-purpose bidirectional i/o port with software configurable pullups. 12.3.1 port a data register (pta) the port a data register contains a data latch for each of the eight port a pins. pta[7:0] ?port a data bits these read/write bits are software programmable. data direction of each port a pin is under the control of the corresponding bit in data direction register a. reset has no effect on port a data. the port a pullup enable bit, pap, in the port option control register (poc) enables pullups on port a pins if the respective pin is configured as an input. (see 12.9 port options .) 12.3.2 data direction register a (ddra) data direction register a determines whether each port a pin is an input or an output. writing a logic one to a ddra bit enables the output buffer for the corresponding port a pin; a logic zero disables the output buffer. address: $0000 bit 7 654321 bit 0 read: pta7 pta6 pta5 pta4 pta3 pta2 pta1 pta0 write: reset: unaffected by reset figure 12-1. port a data register (pta)
i/o ports port a mc68hc(7)08kh12 ? rev. 1.0 advance information motorola i/o ports 187 ddra[7:0] ?data direction register a bits these read/write bits control port a data direction. reset clears ddra[7:0], configuring all port a pins as inputs. 1 = corresponding port a pin configured as output 0 = corresponding port a pin configured as input note: avoid glitches on port a pins by writing to the port a data register before changing data direction register a bits from 0 to 1. figure 12-3 shows the port a i/o logic. figure 12-3. port a i/o circuit when bit ddrax is a logic one, reading address $0000 reads the ptax data latch. when bit ddrax is a logic zero, reading address $0000 reads the voltage level on the pin. the data latch can always be written, regardless of the state of its data direction bit. table 12-2 summarizes the operation of the port a pins. address: $0004 bit 7 654321 bit 0 read: ddra7 ddra6 ddra5 ddra4 ddra3 ddra2 ddra1 ddra0 write: reset: 00000000 figure 12-2. data direction register a (ddra) read ddra ($0004) write ddra ($0004) reset write pta ($0000) read pta ($0000) ptax ddrax ptax internal data bus
i/o ports advance information mc68hc(7)08kh12 ? rev. 1.0 188 i/o ports motorola 12.4 port b port b is an 8-bit general-purpose bidirectional i/o port with software configurable pullups. 12.4.1 port b data register (ptb) the port b data register contains a data latch for each of the eight port b pins. ptb[7:0] ?port b data bits these read/write bits are software-programmable. data direction of each port b pin is under the control of the corresponding bit in data direction register b. reset has no effect on port b data. the port b pullup enable bit, pbp, in the port option control register (poc) enables pullups on port b pins if the respective pin is configured as an input. (see 12.9 port options .). table 12-2. port a pin functions ddra bit pta bit i/o pin mode accesses to ddra accesses to pta read/write read write 0x (1) input, hi-z (2) ddra[7:0] pin pta[7:0] (3) 1 x output ddra[7:0] pta[7:0] pta[7:0] 1. x = don? care 2. hi-z = high impedance 3. writing affects data register, but does not affect input. address: $0001 bit 7 654321 bit 0 read: ptb7 ptb6 ptb5 ptb4 ptb3 ptb2 ptb1 ptb0 write: reset: unaffected by reset figure 12-4. port b data register (ptb)
i/o ports port b mc68hc(7)08kh12 ? rev. 1.0 advance information motorola i/o ports 189 12.4.2 data direction register b (ddrb) data direction register b determines whether each port b pin is an input or an output. writing a logic one to a ddrb bit enables the output buffer for the corresponding port b pin; a logic zero disables the output buffer. ddrb[7:0] ?data direction register b bits these read/write bits control port b data direction. reset clears ddrb[7:0], configuring all port b pins as inputs. 1 = corresponding port b pin configured as output 0 = corresponding port b pin configured as input note: avoid glitches on port b pins by writing to the port b data register before changing data direction register b bits from 0 to 1. figure 12-6 shows the port b i/o logic. figure 12-6. port b i/o circuit address: $0005 bit 7 654321 bit 0 read: ddrb7 ddrb6 ddrb5 ddrb4 ddrb3 ddrb2 ddrb1 ddrb0 write: reset: 00000000 figure 12-5. data direction register b (ddrb) read ddrb ($0005) write ddrb ($0005) reset write ptb ($0001) read ptb ($0001) ptbx ddrbx ptbx internal data bus
i/o ports advance information mc68hc(7)08kh12 ? rev. 1.0 190 i/o ports motorola when bit ddrbx is a logic one, reading address $0001 reads the ptbx data latch. when bit ddrbx is a logic zero, reading address $0001 reads the voltage level on the pin. the data latch can always be written, regardless of the state of its data direction bit. table 12-3 summarizes the operation of the port b pins. 12.5 port c port c is a 5-bit general-purpose bidirectional i/o port with software configurable pullups and current drive options. 12.5.1 port c data register (ptc) the port c data register contains a data latch for each of the five port c pins. table 12-3. port b pin functions ddrb bit ptb bit i/o pin mode accesses to ddrb accesses to ptb read/write read write 0x (1) 1. x = don? care input, hi-z (2) 2. hi-z = high impedance ddrb[7:0] pin ptb[7:0] (3) 3. writing affects data register, but does not affect input. 1 x output ddrb[7:0] ptb[7:0] ptb[7:0] address: $0002 bit 7 654321 bit 0 read: 0 0 0 ptc4 ptc3 ptc2 ptc1 ptc0 write: reset: unaffected by reset = unimplemented figure 12-7. port c data register (ptc)
i/o ports port c mc68hc(7)08kh12 ? rev. 1.0 advance information motorola i/o ports 191 ptc[4:0] ?port c data bits these read/write bits are software-programmable. data direction of each port c pin is under the control of the corresponding bit in data direction register c. reset has no effect on port c data. the port c pullup enable bit, pcp, in the port option control register (poc) enables pullups on port c pins if the respective pin is configured as an input. (see 12.9 port options .) the led direct drive bit, ldd, in the port option control register (poc) controls the drive options for port c. 12.5.2 data direction register c (ddrc) data direction register c determines whether each port c pin is an input or an output. writing a logic one to a ddrc bit enables the output buffer for the corresponding port c pin; a logic zero disables the output buffer. ddrc[4:0] ?data direction register c bits these read/write bits control port c data direction. reset clears ddrc[4:0], configuring all port c pins as inputs. 1 = corresponding port c pin configured as output 0 = corresponding port c pin configured as input note: avoid glitches on port c pins by writing to the port c data register before changing data direction register c bits from 0 to 1. figure 12-9 shows the port c i/o logic. address: $0006 bit 7 654321 bit 0 read: 0 0 0 ddrc4 ddrc3 ddrc2 ddrc1 ddrc0 write: reset: 00000000 = unimplemented figure 12-8. data direction register c (ddrc)
i/o ports advance information mc68hc(7)08kh12 ? rev. 1.0 192 i/o ports motorola figure 12-9. port c i/o circuit when bit ddrcx is a logic one, reading address $0002 reads the ptcx data latch. when bit ddrcx is a logic zero, reading address $0002 reads the voltage level on the pin. the data latch can always be written, regardless of the state of its data direction bit. table 12-4 summarizes the operation of the port c pins. 12.6 port d port d is an 8-bit general-purpose bidirectional i/o port that shares its pins with the keyboard interrupt module (kbi). all port d pins have built- in schmitt triggered input. table 12-4. port c pin functions ddrc bit ptc bit i/o pin mode accesses to ddrc accesses to ptc read/write read write 0x (1) 1. x = don? care input, hi-z (2) 2. hi-z = high impedance ddrc[4:0] pin ptc[4:0] (3) 3. writing affects data register, but does not affect input. 1 x output ddrc[4:0] ptc[4:0] ptc[4:0] read ddrc ($0006) write ddrc ($0006) reset write ptc ($0002) read ptc ($0002) ptcx ddrcx ptcx internal data bus
i/o ports port d mc68hc(7)08kh12 ? rev. 1.0 advance information motorola i/o ports 193 12.6.1 port d data register (ptd) the port d data register contains a data latch for each of the eight port d pins. ptd[7:0] ?port d data bits these read/write bits are software programmable. data direction of each port d pin is under control of the corresponding bit in data direction register d. reset has no effect on port d data. the port d pullups are automatically enabled if the respective pin is configured as a keyboard interrupt. (see 15.4.1 port-d keyboard interrupt functional description .) the port-d keyboard interrupt enable bits, kbdie7?bdie0, in the port-d keyboard interrupt enable register (kbdier), enable the port d pins as external interrupt pins. see section 15. keyboard interrupt module (kbi) . 12.6.2 data direction register d (ddrd) data direction register d determines whether each port d pin is an input or an output. writing a logic one to a ddrd bit enables the output buffer for the corresponding port d pin; a logic zero disables the output buffer. address: $0003 bit 7 654321 bit 0 read: ptd7 ptd6 ptd5 ptd4 ptd3 ptd2 ptd1 ptd0 write: reset: unaffected by reset alternate function: kbd7 kbd6 kbd5 kbd4 kbd3 kbd2 kbd1 kbd0 figure 12-10. port d data register (ptd)
i/o ports advance information mc68hc(7)08kh12 ? rev. 1.0 194 i/o ports motorola ddrd[7:0] ?data direction register d bits these read/write bits control port d data direction. reset clears ddrd[7:0], configuring all port d pins as inputs. 1 = corresponding port d pin configured as output 0 = corresponding port d pin configured as input note: avoid glitches on port d pins by writing to the port d data register before changing data direction register d bits from 0 to 1. figure 12-12 shows the port d i/o logic. figure 12-12. port d i/o circuit when bit ddrdx is a logic one, reading address $0003 reads the ptdx data latch. when bit ddrdx is a logic zero, reading address $0003 reads the voltage level on the pin. the data latch can always be written, regardless of the state of its data direction bit. table 12-5 summarizes the operation of the port d pins. address: $0007 bit 7 654321 bit 0 read: ddrd7 ddrd6 ddrd5 ddrd4 ddrd3 ddrd2 ddrd1 ddrd0 write: reset: 00000000 figure 12-11. data direction register d (ddrd) read ddrd ($0007) write ddrd ($0007) reset write ptd ($0003) read ptd ($0003) ptdx ddrdx ptdx internal data bus
i/o ports port e mc68hc(7)08kh12 ? rev. 1.0 advance information motorola i/o ports 195 12.7 port e port e is a 5-bit special function port that shares four of its pins with the keyboard interrupt module (kbi) and shares three of its pins with the timer interface module (tim). pte3?te0 pins have built-in schmitt triggered input and software configurable pull-up; in addition, pte3?te0 pins have built-in optical interface circuit which can be enabled via the port-e optical interface enable register. 12.7.1 port e data register (pte) the port e data register contains a data latch for each of the five port e pins. table 12-5. port d pin functions ddrd bit ptd bit i/o pin mode accesses to ddrd accesses to ptd read/write read write 0x (1) input, hi-z (2) ddrd[7:0] pin ptd[7:0] (3) 1 x output ddrd[7:0] ptd[7:0] ptd[7:0] 1. x = don? care 2. hi-z = high impedance 3. writing affects data register, but does not affect input. address: $0008 bit 7 654321 bit 0 read: 0 0 0 pte4 pte3 pte2 pte1 pte0 write: reset: unaffected by reset = unimplemented alternate function: kbe3 kbe2 kbe1 kbe0 alternate function: tch1 tch0 tclk figure 12-13. port e data register (pte)
i/o ports advance information mc68hc(7)08kh12 ? rev. 1.0 196 i/o ports motorola pte[4:0] ?port e data bits pte[4:0] are read/write, software-programmable bits. data direction of each port e pin is under the control of the corresponding bit in data direction register e. tch1-tch0 ?timer channel i/o bits the pte2/tch1-pte1/tch0 pins are the tim input capture/output compare pins. the edge/level select bits, elsxb and elsxa, determine whether the pte2/tch1?te1/tch0 pins are timer channel i/o pins or general-purpose i/o pins. see section 11. timer interface module (tim) . note: data direction register e (ddre) does not affect the data direction of port e pins that are being used by the tim. however, the ddre bits always determine whether reading port e returns the states of the latches or the states of the pins. tclk ?timer clock input the pte0/tclk pin is the external clock input for the tim. the prescaler select bits, ps2-ps0, selects pe0/tclk as the tim clock input. when not selected as the tim clock, pe0/tclk is available for general purpose i/o. see section 11. timer interface module (tim) . the pepe[3:0] bits in the port e keyboard interrupt enable register enable individual pull-ups on port e pins pte3?te0 if the respective pin is configured as an input. (see 15.5.3.2 port-e keyboard interrupt enable register .) the port-e keyboard interrupt enable bits, kbeie3?beie0, in the port- e keyboard interrupt enable register (kbeier), enable the port e pins as external interrupt pins. see section 15. keyboard interrupt module (kbi) . 12.7.2 data direction register e (ddre) data direction register e determines whether each port e pin is an input or an output. writing a logic one to a ddre bit enables the output buffer for the corresponding port e pin; a logic zero disables the output buffer.
i/o ports port e mc68hc(7)08kh12 ? rev. 1.0 advance information motorola i/o ports 197 ddre[4:0] ?data direction register e bits these read/write bits control port e data direction. reset clears ddre[4:0], configuring all port e pins as inputs. 1 = corresponding port e pin configured as output 0 = corresponding port e pin configured as input note: avoid glitches on port e pins by writing to the port e data register before changing data direction register e bits from 0 to 1. figure 12-15 shows the port e i/o logic. figure 12-15. port e i/o circuit when bit ddrex is a logic one, reading address $0008 reads the ptex data latch. when bit ddrex is a logic zero, reading address $0008 reads the voltage level on the pin. the data latch can always be written, regardless of the state of its data direction bit. table 12-4 summarizes the operation of the port e pins. address: $000a bit 7 654321 bit 0 read: 0 0 0 ddre4 ddre3 ddre2 ddre1 ddre0 write: reset: 00000000 = unimplemented figure 12-14. data direction register e (ddre) read ddre ($000a) write ddre ($000a) reset write pte ($0008) read pte ($0008) ptex ddrex ptex internal data bus
i/o ports advance information mc68hc(7)08kh12 ? rev. 1.0 198 i/o ports motorola 12.7.3 port-e optical interface enable register port e pins pte3?te0, each has an optical coupling interface circuit which is specially built for optical mouse application. bits [1:0] of the optical interface enable register enable or disable the interface circuit in each port e pins pte3?te0, whilst bits [7:2] define the reference level for the optical interface circuit for optimum performance. oiex ?optical interface enable x. this enables optical interface on pte0 and pte1 pins. it also enables the voltage divider circuit. 1 = pte0 and pte1 optical interface enabled. 0 = pte0 and pte1 optical interface disabled. oiey ?optical interface enable y. this enables optical interface on pte2 and pte3 pins. it also enables the voltage divider circuit. 1 = pte2 and pte3 optical interface enabled. 0 = pte2 and pte3 optical interface disabled. table 12-6. port e pin functions ddre bit pte bit i/o pin mode accesses to ddre accesses to pte read/write read write 0x (1) input, hi-z (2) ddre[4:0] pin pte[4:0] (3) 1 x output ddre[4:0] pte[4:0] pte[4:0] 1. x = don? care 2. hi-z = high impedance 3. writing affects data register, but does not affect input. address: $001c bit 7 654321 bit 0 read: yref2 yref1 yref0 xref2 xref1 xref0 oiey oiex write: reset: 01001000 figure 12-16. optical interface enable register e (eoier)
i/o ports port e mc68hc(7)08kh12 ? rev. 1.0 advance information motorola i/o ports 199 xref2?ref0 ?reference voltage selection x these bits sets the slicing reference voltage for optical interface associated with pte0 and pte1. yref2?ref0 ?reference voltage selection y these bits sets the slicing reference voltage for optical interface associated with pte2 and pte3. xref[2:0] / yref[2:0] pte0-pte1 / pte2-pte3 reference voltage (mv) 0 200 1 300 2 400 3 500 4 600 5 700 6 800 7 900
i/o ports advance information mc68hc(7)08kh12 ? rev. 1.0 200 i/o ports motorola figure 12-17. optical interface voltage references x-vref voltage divider enable voltage selector y-vref voltage selector y - reference x - reference yref2 yref1 yref0 xref2 xref1 xref0 oiey oiex optical interface register ($001c)
i/o ports port e mc68hc(7)08kh12 ? rev. 1.0 advance information motorola i/o ports 201 figure 12-18. port e optical coupling interface pte0 port logic pte0 optical interface output buffer mux select pte1 port logic pte1 optical interface output buffer x-vref oiex (bit0 of $1c) 0 1 mux select 0 1 internal data bus pte2 port logic pte2 optical interface output buffer mux select pte3 port logic pte3 optical interface output buffer y-vref oiey (bit1 of $1c) 0 1 mux select 0 1
i/o ports advance information mc68hc(7)08kh12 ? rev. 1.0 202 i/o ports motorola 12.8 port f port f is an 8-bit general-purpose bidirectional i/o port that shares its pins with the keyboard interrupt module (kbi). all port f pins have built- in schmitt triggered input and software configurable pull-up. 12.8.1 port f data register (ptf) the port f data register contains a data latch for each of the eight port f pins. ptf[7:0] ?port f data bits these read/write bits are software programmable. data direction of each port f pin is under the control of the corresponding bit in data direction register f. reset has no effect on port f data. the port-f keyboard interrupt enable bits, kbfie7?bfie0, in the port-f keyboard interrupt enable register (kbfier), enable the port f pins as external interrupt pins. see section 15. keyboard interrupt module (kbi) . the pfpe[7:0] bits in the port f keyboard pull-up enable register enable individual pull-ups on port f pins if the respective pin is configured as an input. (see 15.6.3.3 port-f pull-up enable register .) address: $0009 bit 7 654321 bit 0 read: ptf7 ptf6 ptf5 ptf4 ptf3 ptf2 ptf1 ptf0 write: reset: unaffected by reset alternate function: kbf7 kbf6 kbf5 kbf4 kbf3 kbf2 kbf1 kbf0 figure 12-19. port f data register (ptf)
i/o ports port f mc68hc(7)08kh12 ? rev. 1.0 advance information motorola i/o ports 203 12.8.2 data direction register f (ddrf) data direction register f determines whether each port f pin is an input or an output. writing a logic one to a ddrf bit enables the output buffer for the corresponding port f pin; a logic zero disables the output buffer. ddrf[7:0] ?data direction register f bits these read/write bits control port f data direction. reset clears ddrf[7:0], configuring all port f pins as inputs. 1 = corresponding port f pin configured as output 0 = corresponding port f pin configured as input note: avoid glitches on port f pins by writing to the port f data register before changing data direction register f bits from 0 to 1. figure 12-3 shows the port f i/o logic. figure 12-21. port f i/o circuit address: $000b bit 7 654321 bit 0 read: ddrf7 ddrf6 ddrf5 ddrf4 ddrf3 ddrf2 ddrf1 ddrf0 write: reset: 00000000 figure 12-20. data direction register f (ddrf) read ddrf ($000b) write ddrf ($000b) reset write ptf ($0009) read ptf ($0009) ptfx ddrfx ptfx internal data bus
i/o ports advance information mc68hc(7)08kh12 ? rev. 1.0 204 i/o ports motorola when bit ddrfx is a logic one, reading address $0009 reads the ptfx data latch. when bit ddrfx is a logic zero, reading address $0009 reads the voltage level on the pin. the data latch can always be written, regardless of the state of its data direction bit. table 12-7 summarizes the operation of the port f pins. 12.9 port options all pins of port a, port b and port c have programmable pullup resistors. port c also has led drive capability. 12.9.1 port option control register (poc) the pullup option for each port is controlled by one bit in the port option control register. one bit controls the led drive configuration on port c. table 12-7. port f pin functions ddre bit pte bit i/o pin mode accesses to ddre accesses to pte read/write read write 0x (1) 1. x = don? care input, hi-z (2) 2. hi-z = high impedance ddrf[7:0] pin ptf[7:0] (3) 3. writing affects data register, but does not affect input. 1 x output ddrf[7:0] ptf[7:0] ptf[7:0] address: $001d bit 7 654321 bit 0 read: 0 0 ldd 00 pcp pbp pap write: reset: 00100000 = unimplemented figure 12-22. port option control register (poc)
i/o ports port options mc68hc(7)08kh12 ? rev. 1.0 advance information motorola i/o ports 205 ldd ?led direct drive control this read/write bit controls the output current capability of port c. when set, the port c pins have current limiting ability so that a led can be connected directly between the port pin and v dd or v ss without the need of a series resistor. 1 = when respective port is configured as an output, make port c become current limiting 3 ma source/10 ma sink port pins 0 = configure port c to become standard i/o port pins pcp ?port c pullup enable this read/write bit controls the pullup option for port c[7:0] if its respective port pin is configured as an input. 1 = configure port c to have internal pullups 0 = disconnect port c internal pullups pbp ?port b pullup enable this read/write bit controls the pullup option for the eight bits of port b if its respective port pin is configured as an input. 1 = configure port b to have internal pullups 0 = disconnect port b internal pullups pap ?port a pullup enable this read/write bit controls the pullup option for the eight bits of port a if its respective port pin is configured as an input. 1 = configure port a to have internal pullups 0 = disconnect port a internal pullups
i/o ports advance information mc68hc(7)08kh12 ? rev. 1.0 206 i/o ports motorola
mc68hc(7)08kh12 ? rev. 1.0 advance information motorola computer operating properly (cop) 207 advance information ?mc68hc(7)08kh12 section 13. computer operating properly (cop) 13.1 contents 13.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207 13.3 functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208 13.4 i/o signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209 13.4.1 cgmxclk. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209 13.4.2 copctl write . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209 13.4.3 power-on reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210 13.4.4 internal reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210 13.4.5 reset vector fetch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210 13.4.6 copd (cop disable) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210 13.4.7 coprs (cop rate select). . . . . . . . . . . . . . . . . . . . . . . . 210 13.5 cop control register (copctl) . . . . . . . . . . . . . . . . . . . . . . 211 13.6 interrupts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211 13.7 monitor mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211 13.8 low-power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212 13.8.1 wait mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212 13.8.2 stop mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212 13.9 cop module during break mode . . . . . . . . . . . . . . . . . . . . . . 212 13.2 introduction this section describes the computer operating properly module, a free- running counter that generates a reset if allowed to overflow. the cop module helps software recover from runaway code. prevent a cop reset by periodically clearing the cop counter.
computer operating properly (cop) advance information mc68hc(7)08kh12 ? rev. 1.0 208 computer operating properly (cop) motorola 13.3 functional description figure 13-1 shows the structure of the cop module. figure 13-1. cop block diagram copctl write cgmxclk reset vector fetch reset circuit reset status register internal reset sources 12-bit sim counter clear all stages 6-bit cop counter cop disable reset copctl write clear cop module copen (from sim) cop counter cop clock cop timeout stop instruction (copd from config) cop rate sel (coprs from config) clear stages 5?2 table 13-1. cop i/o port register summary addr. register name bit 7 654321 bit 0 $001f con?uration register (config) ? read: 0000 ssrec coprs stop copd write: reset: 00000000 $ffff cop control register (copctl) read: low byte of reset vector write: clear cop counter reset: unaffected by reset ? one-time writable register = unimplemented
computer operating properly (cop) i/o signals mc68hc(7)08kh12 ? rev. 1.0 advance information motorola computer operating properly (cop) 209 the cop counter is a free-running 6-bit counter preceded by the 12-bit sim counter. if not cleared by software, the cop counter overflows and generates an asynchronous reset after 2 18 ?2 4 or 2 13 ?2 4 cgmxclk cycles, depending on the setting of the cop rate select bit, coprs, in the configuration register. with a 2 18 ?2 4 cgmxclk cycle overflow option, a 6mhz crystal gives a cop timeout period of 43.688ms. writing any value to location $ffff before an overflow occurs prevents a cop reset by clearing the cop counter and stages 12 through 5 of the sim counter. note: service the cop immediately after reset and before entering or after exiting stop mode to guarantee the maximum time before the first cop counter overflow. a cop reset pulls the rst pin low for 32 cgmxclk cycles and sets the cop bit in the reset status register (rsr) (see 7.8.2 reset status register (rsr) ). note: place cop clearing instructions in the main program and not in an interrupt subroutine. such an interrupt subroutine could keep the cop from generating a reset even while the main program is not working properly. 13.4 i/o signals the following paragraphs describe the signals shown in figure 13-1 . 13.4.1 cgmxclk cgmxclk is the crystal oscillator output signal. cgmxclk frequency is equal to the crystal frequency. 13.4.2 copctl write writing any value to the cop control register (copctl) (see 13.5 cop control register (copctl) ) clears the cop counter and clears bits 12 through 4 of the sim counter. reading the cop control register returns the low byte of the reset vector.
computer operating properly (cop) advance information mc68hc(7)08kh12 ? rev. 1.0 210 computer operating properly (cop) motorola 13.4.3 power-on reset the power-on reset (por) circuit in the sim clears the sim counter 4096 cgmxclk cycles after power-up. 13.4.4 internal reset an internal reset clears the sim counter and the cop counter. 13.4.5 reset vector fetch a reset vector fetch occurs when the vector address appears on the data bus. a reset vector fetch clears the sim counter. 13.4.6 copd (cop disable) the copd signal reflects the state of the cop disable bit (copd) in the configuration register (config). (see figure 13-2 . configuration register (config) .) 13.4.7 coprs (cop rate select) the coprs signal reflects the state of the cop rate select bit (coprs) in the configuration register. (see figure 13-2 . configuration register (config) .) address: $001f bit 7 654321 bit 0 read: 0000 ssrec coprs stop copd write: reset: 00000000 = unimplemented this is a write-once after reset register. (see section 5. con?uration register (config) .) figure 13-2. configuration register (config)
computer operating properly (cop) cop control register (copctl) mc68hc(7)08kh12 ? rev. 1.0 advance information motorola computer operating properly (cop) 211 coprs ?cop rate select bit coprs selects the cop timeout period. reset clears coprs. 1 = cop reset cycle is (2 13 ? 4 ) cgmxclk 0 = cop reset cycle is (2 18 ? 4 ) cgmxclk copd ?cop disable bit copd disables the cop module. 1 = cop module disabled 0 = cop module enabled 13.5 cop control register (copctl) the cop control register is located at address $ffff and overlaps the reset vector. writing any value to $ffff clears the cop counter and starts a new timeout period. reading location $ffff returns the low byte of the reset vector. 13.6 interrupts the cop does not generate cpu interrupt requests. 13.7 monitor mode the cop is disabled in monitor mode when v dd + v hi is present on the irq1 /v pp pin or on the rst pin. address: $ffff bit 7 654321 bit 0 read: low byte of reset vector write: clear cop counter reset: unaffected by reset figure 13-3. cop control register (copctl)
computer operating properly (cop) advance information mc68hc(7)08kh12 ? rev. 1.0 212 computer operating properly (cop) motorola 13.8 low-power modes the wait and stop instructions put the mcu in low-power consumption standby modes. 13.8.1 wait mode the cop continues to operate during wait mode. to prevent a cop reset during wait mode, periodically clear the cop counter in a cpu interrupt routine. 13.8.2 stop mode stop mode turns off the cgmxclk input to the cop and clears the sim counter. service the cop immediately before entering or after exiting stop mode to ensure a full cop timeout period after entering or exiting stop mode. 13.9 cop module during break mode the cop is disabled during a break interrupt when v dd + v hi is present on the rst pin.
mc68hc(7)08kh12 ? rev. 1.0 advance information motorola external interrupt (irq) 213 advance information ?mc68hc(7)08kh12 section 14. external interrupt (irq) 14.1 contents 14.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213 14.3 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213 14.4 functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214 14.4.1 irq1 /v pp pin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215 14.5 irq module during break interrupts . . . . . . . . . . . . . . . . . . . 217 14.6 irq status and control register (iscr) . . . . . . . . . . . . . . . . 217 14.2 introduction the irq module provides a non-maskable interrupt input. 14.3 features features of the irq module include the following: a dedicated external interrupt pin (irq1 /v pp ) irq1 interrupt control bits hysteresis buffer programmable edge-only or edge and level interrupt sensitivity automatic interrupt acknowledge irq1 /v pp pin includes internal pullup resistor
external interrupt (irq) advance information mc68hc(7)08kh12 ? rev. 1.0 214 external interrupt (irq) motorola 14.4 functional description a logic zero applied to the external interrupt pin can latch a cpu interrupt request. figure 14-1 shows the structure of the irq module. interrupt signals on the irq1 /v pp pin are latched into the irq1 latch. an interrupt latch remains set until one of the following actions occurs: vector fetch ?a vector fetch automatically generates an interrupt acknowledge signal that clears the irq latch. software clear ?software can clear the interrupt latch by writing to the acknowledge bit in the interrupt status and control register (iscr). writing a logic one to the ack1 bit clears the irq1 latch. reset ?a reset automatically clears the interrupt latch. the external interrupt pin is falling-edge-triggered and is software- configurable to be either falling-edge or low-level-triggered. the mode1 bit in the iscr controls the triggering sensitivity of the irq1 /v pp pin. when the interrupt pin is edge-triggered only, the cpu interrupt request remains set until a vector fetch, software clear, or reset occurs. when the interrupt pin is both falling-edge and low-level-triggered, the cpu interrupt request remains set until both of the following occur: vector fetch or software clear return of the interrupt pin to logic one the vector fetch or software clear may occur before or after the interrupt pin returns to logic one. as long as the pin is low, the interrupt request remains pending. a reset will clear the latch and the mode1 control bit, thereby clearing the interrupt even if the pin stays low. when set, the imask1 bit in the iscr mask all external interrupt requests. a latched interrupt request is not presented to the interrupt priority logic unless the imask1 bit is clear. note: the interrupt mask (i) in the condition code register (ccr) masks all interrupt requests, including external interrupt requests. (see 7.6 exception control .)
external interrupt (irq) functional description mc68hc(7)08kh12 ? rev. 1.0 advance information motorola external interrupt (irq) 215 figure 14-1. irq module block diagram 14.4.1 irq1 /v pp pin a logic zero on the irq1 /v pp pin can latch an interrupt request into the irq1 latch. a vector fetch, software clear, or reset clears the irq1 latch. if the mode1 bit is set, the irq1 /v pp pin is both falling-edge-sensitive and low-level-sensitive. with mode1 set, both of the following actions must occur to clear irq1: ack1 imask1 dq ck clr irq1 high interrupt to mode select logic irq1 ff request irq1 /v pp v dd mode1 voltage detect synchro- nizer irqf1 to cpu for bil/bih instructions vector fetch decoder internal address bus reset v dd i nternal pullup device table 14-1. irq i/o port register summary addr. register name bit 7 654321 bit 0 $001e irq status/control register (iscr) read: 0000 irqf1 0 imask1 mode1 write: ack1 reset: 00000000 = unimplemented
external interrupt (irq) advance information mc68hc(7)08kh12 ? rev. 1.0 216 external interrupt (irq) motorola vector fetch or software clear ?a vector fetch generates an interrupt acknowledge signal to clear the latch. software may generate the interrupt acknowledge signal by writing a logic one to the ack1 bit in the interrupt status and control register (iscr). the ack1 bit is useful in applications that poll the irq1 /v pp pin and require software to clear the irq1 latch. writing to the ack1 bit prior to leaving an interrupt service routine can also prevent spurious interrupts due to noise. setting ack1 does not affect subsequent transitions on the irq1 /v pp pin. a falling edge that occurs after writing to the ack1 bit latches another interrupt request. if the irq1 mask bit, imask1, is clear, the cpu loads the program counter with the vector address at locations $fffa and $fffb. return of the irq1 /v pp pin to logic one ?as long as the irq1 /v pp pin is at logic zero, irq1 remains active. the vector fetch or software clear and the return of the irq1 /v pp pin to logic one may occur in any order. the interrupt request remains pending as long as the irq1 /v pp pin is at logic zero. a reset will clear the latch and the mode1 control bit, thereby clearing the interrupt even if the pin stays low. if the mode1 bit is clear, the irq1 /v pp pin is falling-edge-sensitive only. with mode1 clear, a vector fetch or software clear immediately clears the irq1 latch. the irqf1 bit in the iscr register can be used to check for pending interrupts. the irqf1 bit is not affected by the imask1 bit, which makes it useful in applications where polling is preferred. use the bih or bil instruction to read the logic level on the irq1 /v pp pin. note: when using the level-sensitive interrupt trigger, avoid false interrupts by masking interrupt requests in the interrupt routine.
external interrupt (irq) irq module during break interrupts mc68hc(7)08kh12 ? rev. 1.0 advance information motorola external interrupt (irq) 217 14.5 irq module during break interrupts the system integration module (sim) controls whether the irq1 latch can be cleared during the break state. the bcfe bit in the break flag control register (bfcr) enables software to clear the latches during the break state. (see section 7. system integration module (sim) .) to allow software to clear the irq1 latch during a break interrupt, write a logic one to the bcfe bit. if a latch is cleared during the break state, it remains cleared when the mcu exits the break state. to protect the latches during the break state, write a logic zero to the bcfe bit. with bcfe at logic zero (its default state), writing to the ack1 bit in the irq status and control register during the break state has no effect on the irq latch. 14.6 irq status and control register (iscr) the irq status and control register (iscr) controls and monitors operation of the irq module. the iscr has the following functions: shows the state of the irq1 flag clears the irq1 latch masks irq1 and interrupt request controls triggering sensitivity of the irq1 /v pp interrupt pin address: $001e bit 7 654321 bit 0 read: 0000 irqf1 0 imask1 mode1 write: ack1 reset: 00000000 = unimplemented figure 14-2. irq status and control register (iscr)
external interrupt (irq) advance information mc68hc(7)08kh12 ? rev. 1.0 218 external interrupt (irq) motorola irqf1 ?irq1 flag this read-only status bit is high when the irq1 interrupt is pending. 1 = irq1 interrupt pending 0 = irq1 interrupt not pending ack1 ?irq1 interrupt request acknowledge bit writing a logic one to this write-only bit clears the irq1 latch. ack1 always reads as logic zero. reset clears ack1. imask1 ?irq1 interrupt mask bit writing a logic one to this read/write bit disables irq1 interrupt requests. reset clears imask1. 1 = irq1 interrupt requests disabled 0 = irq1 interrupt requests enabled mode1 ?irq1 edge/level select bit this read/write bit controls the triggering sensitivity of the irq1 /v pp pin. reset clears mode1. 1 = irq1 /v pp interrupt requests on falling edges and low levels 0 = irq1 /v pp interrupt requests on falling edges only
mc68hc(7)08kh12 ? rev. 1.0 advance information motorola keyboard interrupt module (kbi) 219 advance information ?mc68hc(7)08kh12 section 15. keyboard interrupt module (kbi) 15.1 contents 15.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220 15.3 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220 15.4 port-d keyboard interrupt block diagram . . . . . . . . . . . . . . . 222 15.4.1 port-d keyboard interrupt functional description. . . . . . . 223 15.4.2 port-d keyboard initialization . . . . . . . . . . . . . . . . . . . . . . 224 15.4.3 port-d keyboard interrupt registers . . . . . . . . . . . . . . . . . 225 15.4.3.1 port-d keyboard status and control register: . . . . . . . 225 15.4.3.2 port-d keyboard interrupt enable register . . . . . . . . . . 226 15.5 port-e keyboard interrupt block diagram . . . . . . . . . . . . . . . 228 15.5.1 port-e keyboard interrupt functional description. . . . . . . 229 15.5.2 port-e keyboard initialization . . . . . . . . . . . . . . . . . . . . . . 230 15.5.3 port-e keyboard interrupt registers . . . . . . . . . . . . . . . . . 231 15.5.3.1 port-e keyboard status and control register . . . . . . . . 231 15.5.3.2 port-e keyboard interrupt enable register . . . . . . . . . . 232 15.6 port-f keyboard interrupt block diagram. . . . . . . . . . . . . . . . 234 15.6.1 port-f keyboard interrupt functional description . . . . . . . 235 15.6.2 port-f keyboard initialization . . . . . . . . . . . . . . . . . . . . . . 236 15.6.3 port-f keyboard interrupt registers . . . . . . . . . . . . . . . . . 237 15.6.3.1 port-f keyboard status and control register . . . . . . . . 237 15.6.3.2 port-f keyboard interrupt enable register . . . . . . . . . . 238 15.6.3.3 port-f pull-up enable register . . . . . . . . . . . . . . . . . . . 239 15.7 wait mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239 15.8 stop mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239 15.9 keyboard module during break interrupts . . . . . . . . . . . . . . . 239
keyboard interrupt module (kbi) advance information mc68hc(7)08kh12 ? rev. 1.0 220 keyboard interrupt module (kbi) motorola 15.2 introduction the keyboard module provides twenty independently maskable external interrupts which are accessible via ptd7-ptd0, pte3-pte0 and ptf7-ptf0. though the functionality of the three keyboard interrupts on the three ports is similar, the implementation is quite different. on port-d, enabling keyboard interrupt on a pin also enables its internal pull-up device. on port-e, the pull-up device is control by the pepex bit resided in the port-e keyboard interrupt enable register (kbeier). on port-f, the pull-up device is control by the pfpex bit resided in the port-f control register (pfper). 15.3 features twenty keyboard interrupt pins with separate keyboard interrupt enable bits and three keyboard interrupt masks. hysteresis buffers internal pull-ups. programmable edge-only or edge- and level- interrupt sensitivity exit from low-power modes
keyboard interrupt module (kbi) features mc68hc(7)08kh12 ? rev. 1.0 advance information motorola keyboard interrupt module (kbi) 221 table 15-1. kbi i/o register summary addr. register name bit 7 654321 bit 0 $000c port d keyboard status and control register (kbdscr) read: 0000 keydf 0 imaskd moded write: ackd reset: 00000000 $000d port d keyboard interrupt enable register (kbdier) read: kbdie7 kbdie6 kbdie5 kbdie4 kbdie3 kbdie2 kbdie1 kbdie0 write: reset: 00000000 $000e port e keyboard status and control register (kbescr) read: 0000 keyef 0 imaske modee write: acke reset: 00000000 $000f port e keyboard interrupt enable register (kbeier) read: pepe3 pepe2 pepe1 pepe0 kbeie3 kbeie2 kbeie1 kbeie0 write: reset: 00000000 $0040 port f keyboard status and control register (kbfscr) read: 0000 keyff 0 imaskf modef write: ackf reset: 00000000 $0041 port f keyboard interrupt enable register (kbfier) read: kbfie7 kbfie6 kbfie5 kbfie4 kbfie3 kbfie2 kbfie1 kbfie0 write: reset: 00000000 $0042 port f pull-up enable register (pfper) read: pfpe7 pfpe6 pfpe5 pfpe4 pfpe3 pfpe2 pfpe1 pfpe0 write: reset: 11111111 = unimplemented
keyboard interrupt module (kbi) advance information mc68hc(7)08kh12 ?rev. 1.0 222 keyboard interrupt module (kbi) motorola 15.4 port-d keyboard interrupt block diagram figure 15-1. port-d keyboard interrupt block diagram kbdie0 kbdie7 . . . port-d dq ck clr v dd moded imaskd keyboard interrupt ff vector fetch decoder ackd internal bus reset to pullup enable kbd7 kbd0 to pullup enable synchronizer keydf keyboard interrupt request
keyboard interrupt module (kbi) port-d keyboard interrupt block diagram mc68hc(7)08kh12 ? rev. 1.0 advance information motorola keyboard interrupt module (kbi) 223 15.4.1 port-d keyboard interrupt functional description writing to the kbdie7?bdie0 bits in the keyboard interrupt enable register independently enables or disables each port d pin as a keyboard interrupt pin. enabling a keyboard interrupt pin in port-d also enables its internal pullup device. a logic 0 applied to an enabled keyboard interrupt pin latches a keyboard interrupt request. a keyboard interrupt is latched when one or more keyboard pins goes low after all were high. the moded bit in the keyboard status and control register controls the triggering mode of the keyboard interrupt. if the keyboard interrupt is edge-sensitive only, a falling edge on a keyboard pin does not latch an interrupt request if another keyboard pin is already low. to prevent losing an interrupt request on one pin because another pin is still low, software can disable the latter pin while it is low. if the keyboard interrupt is falling edge- and low level-sensitive, an interrupt request is present as long as any keyboard pin is low. if the moded bit is set, the keyboard interrupt pins are both falling edge- and low level-sensitive, and both of the following actions must occur to clear a keyboard interrupt request: vector fetch or software clear ?a vector fetch generates an interrupt acknowledge signal to clear the interrupt request. software may generate the interrupt acknowledge signal by writing a logic 1 to the ackd bit in the keyboard status and control register kbdscr. the ackd bit is useful in applications that poll the keyboard interrupt pins and require software to clear the keyboard interrupt request. writing to the ackd bit prior to leaving an interrupt service routine can also prevent spurious interrupts due to noise. setting ackd does not affect subsequent transitions on the keyboard interrupt pins. a falling edge that occurs after writing to the ackd bit latches another interrupt request. if the keyboard interrupt mask bit, imaskd, is clear, the cpu loads the program counter with the vector address at locations $ffea and $ffeb.
keyboard interrupt module (kbi) advance information mc68hc(7)08kh12 ? rev. 1.0 224 keyboard interrupt module (kbi) motorola return of all enabled keyboard interrupt pins to logic 1 ?as long as any enabled keyboard interrupt pin is at logic 0, the keyboard interrupt remains set. the vector fetch or software clear and the return of all enabled keyboard interrupt pins to logic 1 may occur in any order. if the moded bit is clear, the keyboard interrupt pin is falling-edge-sensitive only. with moded clear, a vector fetch or software clear immediately clears the keyboard interrupt request. reset clears the keyboard interrupt request and the moded bit, clearing the interrupt request even if a keyboard interrupt pin stays at logic 0. the keyboard flag bit (keydf) in the keyboard status and control register can be used to see if a pending interrupt exists. the keydf bit is not affected by the keyboard interrupt mask bit (imaskd) which makes it useful in applications where polling is preferred. to determine the logic level on a keyboard interrupt pin, use the data direction register to configure the pin as an input and read the data register. note: setting a keyboard interrupt enable bit (kbdiex) forces the corresponding keyboard interrupt pin to be an input, overriding the data direction register. however, the data direction register bit must be a logic 0 for software to read the pin. 15.4.2 port-d keyboard initialization when a keyboard interrupt pin is enabled, it takes time for the internal pullup to reach a logic 1. therefore a false interrupt can occur as soon as the pin is enabled. to prevent a false interrupt on keyboard initialization: 1. mask keyboard interrupts by setting the imaskd bit in the keyboard status and control register. 2. enable the kbi pins by setting the appropriate kbdiex bits in the keyboard interrupt enable register.
keyboard interrupt module (kbi) port-d keyboard interrupt block diagram mc68hc(7)08kh12 ? rev. 1.0 advance information motorola keyboard interrupt module (kbi) 225 3. write to the ackd bit in the keyboard status and control register to clear any false interrupts. 4. clear the imaskd bit. an interrupt signal on an edge-triggered pin can be acknowledged immediately after enabling the pin. an interrupt signal on an edge- and level-triggered interrupt pin must be acknowledged after a delay that depends on the external load. another way to avoid a false interrupt for port-d: 1. configure the keyboard pins as outputs by setting the appropriate ddrd bits in data direction register d. 2. write logic 1s to the appropriate port-d data register bits. 3. enable the kbdi pins by setting the appropriate kbdiex bits in the keyboard interrupt enable register. 15.4.3 port-d keyboard interrupt registers 15.4.3.1 port-d keyboard status and control register: flags keyboard interrupt requests. acknowledges keyboard interrupt requests. masks keyboard interrupt requests. controls keyboard interrupt triggering sensitivity. bits [7:4] ?not used these read-only bits always read as logic 0s. address: $000c bit 7 654321 bit 0 read: 0000 keydf 0 imaskd moded write: ackd reset: 00000000 = unimplemented figure 15-2. port-d keyboard status and control register (kbdscr)
keyboard interrupt module (kbi) advance information mc68hc(7)08kh12 ? rev. 1.0 226 keyboard interrupt module (kbi) motorola keydf ?port-d keyboard flag bit this read-only bit is set when a keyboard interrupt is pending on port-d. reset clears the keydf bit. 1 = keyboard interrupt pending 0 = no keyboard interrupt pending ackd ?port-d keyboard acknowledge bit writing a logic 1 to this write-only bit clears the keyboard interrupt request on port-d. ackd always reads as logic 0. reset clears ackd. imaskd ?port-d keyboard interrupt mask bit writing a logic 1 to this read/write bit prevents the output of the keyboard interrupt mask from generating interrupt requests on port-d. reset clears the imaskd bit. 1 = keyboard interrupt requests masked 0 = keyboard interrupt requests not masked moded ?port-d keyboard triggering sensitivity bit this read/write bit controls the triggering sensitivity of the keyboard interrupt pins on port-d. reset clears moded. 1 = keyboard interrupt requests on falling edges and low levels 0 = keyboard interrupt requests on falling edges only 15.4.3.2 port-d keyboard interrupt enable register the port-d keyboard interrupt enable register enables or disables each port-d pin to operate as a keyboard interrupt pin. address: $000d bit 7 654321 bit 0 read: kbdie7 kbdie6 kbdie5 kbdie4 kbdie3 kbdie2 kbdie1 kbdie0 write: reset: 00000000 figure 15-3. port-d keyboard interrupt enable register (kbdier)
keyboard interrupt module (kbi) port-d keyboard interrupt block diagram mc68hc(7)08kh12 ? rev. 1.0 advance information motorola keyboard interrupt module (kbi) 227 kbdie7?bdie0 ?port-d keyboard interrupt enable bits each of these read/write bits enables the corresponding keyboard interrupt pin on port-d to latch interrupt requests. reset clears the keyboard interrupt enable register. 1 = kbdx pin enabled as keyboard interrupt pin 0 = kbdx pin not enabled as keyboard interrupt pin
keyboard interrupt module (kbi) advance information mc68hc(7)08kh12 ?rev. 1.0 228 keyboard interrupt module (kbi) motorola 15.5 port-e keyboard interrupt block diagram figure 15-4. port-e keyboard interrupt block diagram kbeie0 kbeie3 . . . dq ck clr v dd modee imaske keyboard interrupt ff vector fetch decoder acke internal bus reset kbe3 kbe0 synchronizer keyef port-e keyboard interrupt request pepe0 pepe3 to pullup enable to pullup enable
keyboard interrupt module (kbi) port-e keyboard interrupt block diagram mc68hc(7)08kh12 ? rev. 1.0 advance information motorola keyboard interrupt module (kbi) 229 15.5.1 port-e keyboard interrupt functional description writing to the kbeie3?beie0 bits in the keyboard interrupt enable register independently enables or disables each port e pin as a keyboard interrupt pin. enabling a keyboard interrupt pin in port-e does not enable its internal pullup device. writing to the pepe3?epe0 bits in the keyboard interrupt enable register independently enables or disables each port e pin pull-up device. a logic 0 applied to an enabled keyboard interrupt pin latches a keyboard interrupt request. a keyboard interrupt is latched when one or more keyboard pins goes low after all were high. the modee bit in the keyboard status and control register controls the triggering mode of the keyboard interrupt. if the keyboard interrupt is edge-sensitive only, a falling edge on a keyboard pin does not latch an interrupt request if another keyboard pin is already low. to prevent losing an interrupt request on one pin because another pin is still low, software can disable the latter pin while it is low. if the keyboard interrupt is falling edge- and low level-sensitive, an interrupt request is present as long as any keyboard pin is low. if the modee bit is set, the keyboard interrupt pins are both falling edge- and low level-sensitive, and both of the following actions must occur to clear a keyboard interrupt request: vector fetch or software clear ?a vector fetch generates an interrupt acknowledge signal to clear the interrupt request. software may generate the interrupt acknowledge signal by writing a logic 1 to the acke bit in the keyboard status and control register kbescr. the acke bit is useful in applications that poll the keyboard interrupt pins and require software to clear the keyboard interrupt request. writing to the acke bit prior to leaving an interrupt service routine can also prevent spurious interrupts due to noise. setting acke does not affect subsequent transitions on the keyboard interrupt pins. a falling edge that occurs after writing to the acke bit latches another interrupt request. if the keyboard interrupt mask bit, imaske, is clear, the cpu loads the program counter with the vector address at locations $ffec and $ffed.
keyboard interrupt module (kbi) advance information mc68hc(7)08kh12 ? rev. 1.0 230 keyboard interrupt module (kbi) motorola return of all enabled keyboard interrupt pins to logic 1 ?as long as any enabled keyboard interrupt pin is at logic 0, the keyboard interrupt remains set. the vector fetch or software clear and the return of all enabled keyboard interrupt pins to logic 1 may occur in any order. if the modee bit is clear, the keyboard interrupt pin is falling-edge-sensitive only. with modee clear, a vector fetch or software clear immediately clears the keyboard interrupt request. reset clears the keyboard interrupt request and the modee bit, clearing the interrupt request even if a keyboard interrupt pin stays at logic 0. the keyboard flag bit (keyef) in the keyboard status and control register can be used to see if a pending interrupt exists. the keyef bit is not affected by the keyboard interrupt mask bit (imaske) which makes it useful in applications where polling is preferred. to determine the logic level on a keyboard interrupt pin, disable the pull-up device, use the data direction register to configure the pin as an input and then read the data register. note: setting a keyboard interrupt enable bit (kbeiex) forces the corresponding keyboard interrupt pin to be an input, overriding the data direction register. 15.5.2 port-e keyboard initialization when a keyboard interrupt pin is enabled, it takes time for the internal pullup to reach a logic 1. therefore a false interrupt can occur as soon as the pin is enabled. to prevent a false interrupt on keyboard initialization: 1. mask keyboard interrupts by setting the imaske bit in the keyboard status and control register. 2. write to ddrex bits to make port pin an input pin. 3. enable the kbi pins by setting the appropriate kbeiex bits in the keyboard interrupt enable register.
keyboard interrupt module (kbi) port-e keyboard interrupt block diagram mc68hc(7)08kh12 ? rev. 1.0 advance information motorola keyboard interrupt module (kbi) 231 4. write to the acke bit in the keyboard status and control register to clear any false interrupts. 5. clear the imaske bit. an interrupt signal on an edge-triggered pin can be acknowledged immediately after enabling the pin. an interrupt signal on an edge- and level-triggered interrupt pin must be acknowledged after a delay that depends on the external load. 15.5.3 port-e keyboard interrupt registers 15.5.3.1 port-e keyboard status and control register flags keyboard interrupt requests. acknowledges keyboard interrupt requests. masks keyboard interrupt requests. controls keyboard interrupt triggering sensitivity. bits [7:4] ?not used these read-only bits always read as logic 0s. keyef ?port-e keyboard flag bit this read-only bit is set when a keyboard interrupt is pending on port-e. reset clears the keyef bit. 1 = keyboard interrupt pending 0 = no keyboard interrupt pending address: $000e bit 7 654321 bit 0 read: 0000 keyef 0 imaske modee write: acke reset: 00000000 = unimplemented figure 15-5. port-e keyboard status and control register (kbescr)
keyboard interrupt module (kbi) advance information mc68hc(7)08kh12 ? rev. 1.0 232 keyboard interrupt module (kbi) motorola acke ?port-e keyboard acknowledge bit writing a logic 1 to this write-only bit clears the keyboard interrupt request on port-e. acke always reads as logic 0. reset clears acke. imaske ?port-e keyboard interrupt mask bit writing a logic 1 to this read/write bit prevents the output of the keyboard interrupt mask from generating interrupt requests on port-e. reset clears the imaske bit. 1 = keyboard interrupt requests masked 0 = keyboard interrupt requests not masked modee ?port-e keyboard triggering sensitivity bit this read/write bit controls the triggering sensitivity of the keyboard interrupt pins on port-e. reset clears modee. 1 = keyboard interrupt requests on falling edges and low levels 0 = keyboard interrupt requests on falling edges only 15.5.3.2 port-e keyboard interrupt enable register the port-e keyboard interrupt enable register enables or disables each port-e pin to operate as a keyboard interrupt pin and to enable and disable the pullup device on each port-e pin. pepe3?epe0 ?port-e pull-up enable bits each of these read/write bits enable or disable the pull-up device on the corresponding port-e pin. reset clears these bits. 1 = pepex pull-up device enabled. 0 = pepex pull-up device disabled. address: $000f bit 7 654321 bit 0 read: pepe3 pepe2 pepe1 pepe0 kbeie3 kbeie2 kbeie1 kbeie0 write: reset: 00000000 figure 15-6. port-e keyboard interrupt enable register (kbeier)
keyboard interrupt module (kbi) port-e keyboard interrupt block diagram mc68hc(7)08kh12 ? rev. 1.0 advance information motorola keyboard interrupt module (kbi) 233 kbeie3?beie0 ?port-e keyboard interrupt enable bits each of these read/write bits enables the corresponding keyboard interrupt pin on port-d to latch interrupt requests. reset clears the keyboard interrupt enable register. 1 = kbex pin enabled as keyboard interrupt pin 0 = kbedx pin not enabled as keyboard interrupt pin
keyboard interrupt module (kbi) advance information mc68hc(7)08kh12 ?rev. 1.0 234 keyboard interrupt module (kbi) motorola 15.6 port-f keyboard interrupt block diagram figure 15-7. port-f keyboard interrupt block diagram kbfie0 kbfie7 . . . dq ck clr v dd modef imaskf keyboard interrupt ff vector fetch decoder ackf internal bus reset kbf3 kbf0 synchronizer keyff port-f keyboard interrupt request pfpe0 pfpe7 to pullup enable to pullup enable
keyboard interrupt module (kbi) port-f keyboard interrupt block diagram mc68hc(7)08kh12 ? rev. 1.0 advance information motorola keyboard interrupt module (kbi) 235 15.6.1 port-f keyboard interrupt functional description writing to the kbfie7?bfie0 bits in the keyboard interrupt enable register independently enables or disables each port f pin as a keyboard interrupt pin. enabling a keyboard interrupt pin in port-f does not enable its internal pullup device. writing to the pfpe7?fpe0 bits in the pull-up enable register independently enables or disables each port f pin pull-up device. a logic 0 applied to an enabled keyboard interrupt pin latches a keyboard interrupt request. a keyboard interrupt is latched when one or more keyboard pins goes low after all were high. the modef bit in the keyboard status and control register controls the triggering mode of the keyboard interrupt. if the keyboard interrupt is edge-sensitive only, a falling edge on a keyboard pin does not latch an interrupt request if another keyboard pin is already low. to prevent losing an interrupt request on one pin because another pin is still low, software can disable the latter pin while it is low. if the keyboard interrupt is falling edge- and low level-sensitive, an interrupt request is present as long as any keyboard pin is low. if the modef bit is set, the keyboard interrupt pins are both falling edge- and low level-sensitive, and both of the following actions must occur to clear a keyboard interrupt request: vector fetch or software clear ?a vector fetch generates an interrupt acknowledge signal to clear the interrupt request. software may generate the interrupt acknowledge signal by writing a logic 1 to the ackf bit in the keyboard status and control register kbfscr. the ackf bit is useful in applications that poll the keyboard interrupt pins and require software to clear the keyboard interrupt request. writing to the ackf bit prior to leaving an interrupt service routine can also prevent spurious interrupts due to noise. setting ackf does not affect subsequent transitions on the keyboard interrupt pins. a falling edge that occurs after writing to the ackf bit latches another interrupt request. if the keyboard interrupt mask bit, imaskf, is clear, the cpu loads the program counter with the vector address at locations $ffe8 and $ffe9.
keyboard interrupt module (kbi) advance information mc68hc(7)08kh12 ? rev. 1.0 236 keyboard interrupt module (kbi) motorola return of all enabled keyboard interrupt pins to logic 1 ?as long as any enabled keyboard interrupt pin is at logic 0, the keyboard interrupt remains set. the vector fetch or software clear and the return of all enabled keyboard interrupt pins to logic 1 may occur in any order. if the modef bit is clear, the keyboard interrupt pin is falling-edge-sensitive only. with modef clear, a vector fetch or software clear immediately clears the keyboard interrupt request. reset clears the keyboard interrupt request and the modef bit, clearing the interrupt request even if a keyboard interrupt pin stays at logic 0. the keyboard flag bit (keyff) in the keyboard status and control register can be used to see if a pending interrupt exists. the keyff bit is not affected by the keyboard interrupt mask bit (imaskf) which makes it useful in applications where polling is preferred. to determine the logic level on a keyboard interrupt pin, disable the pull-up device, use the data direction register to configure the pin as an input and then read the data register. note: setting a keyboard interrupt enable bit (kbfiex) forces the corresponding keyboard interrupt pin to be an input, overriding the data direction register. 15.6.2 port-f keyboard initialization when a keyboard interrupt pin is enabled, it takes time for the internal pullup to reach a logic 1. therefore a false interrupt can occur as soon as the pin is enabled. to prevent a false interrupt on keyboard initialization: 1. mask keyboard interrupts by setting the imaskf bit in the keyboard status and control register. 2. write to ddrfx bits to make the port pin an input pin. 3. enable the kbi pins by setting the appropriate kbfiex bits in the keyboard interrupt enable register.
keyboard interrupt module (kbi) port-f keyboard interrupt block diagram mc68hc(7)08kh12 ? rev. 1.0 advance information motorola keyboard interrupt module (kbi) 237 4. write to the ackf bit in the keyboard status and control register to clear any false interrupts. 5. clear the imaskf bit. an interrupt signal on an edge-triggered pin can be acknowledged immediately after enabling the pin. an interrupt signal on an edge- and level-triggered interrupt pin must be acknowledged after a delay that depends on the external load. 15.6.3 port-f keyboard interrupt registers 15.6.3.1 port-f keyboard status and control register flags keyboard interrupt requests. acknowledges keyboard interrupt requests. masks keyboard interrupt requests. controls keyboard interrupt triggering sensitivity. bits [7:4] ?not used these read-only bits always read as logic 0s. keyff ?port-f keyboard flag bit this read-only bit is set when a keyboard interrupt is pending on port-f. reset clears the keyff bit. 1 = keyboard interrupt pending 0 = no keyboard interrupt pending address: $0040 bit 7 654321 bit 0 read: 0000 keyff 0 imaskf modef write: ackf reset: 00000000 = unimplemented figure 15-8. port-f keyboard status and control register (kbfscr)
keyboard interrupt module (kbi) advance information mc68hc(7)08kh12 ? rev. 1.0 238 keyboard interrupt module (kbi) motorola ackf ?port-f keyboard acknowledge bit writing a logic 1 to this write-only bit clears the keyboard interrupt request on port-f. ackf always reads as logic 0. reset clears ackf. imaskf ?port-f keyboard interrupt mask bit writing a logic 1 to this read/write bit prevents the output of the keyboard interrupt mask from generating interrupt requests on port-f. reset clears the imaskf bit. 1 = keyboard interrupt requests masked 0 = keyboard interrupt requests not masked modef ?port-f keyboard triggering sensitivity bit this read/write bit controls the triggering sensitivity of the keyboard interrupt pins on port-f. reset clears modef. 1 = keyboard interrupt requests on falling edges and low levels 0 = keyboard interrupt requests on falling edges only 15.6.3.2 port-f keyboard interrupt enable register the port-f keyboard interrupt enable register enables or disables each port-f pin to operate as a keyboard interrupt pin. kbfie7?bfie0 ?port-f keyboard interrupt enable bits each of these read/write bits enables the corresponding keyboard interrupt pin on port-f to latch interrupt requests. reset clears the keyboard interrupt enable register. 1 = kbfx pin enabled as keyboard interrupt pin 0 = kbfx pin not enabled as keyboard interrupt pin address: $0041 bit 7 654321 bit 0 read: kbfie7 kbfie6 kbfie5 kbfie4 kbfie3 kbfie2 kbfie1 kbfie0 write: reset: 00000000 figure 15-9. port-f keyboard interrupt enable register (kbfier)
keyboard interrupt module (kbi) wait mode mc68hc(7)08kh12 ? rev. 1.0 advance information motorola keyboard interrupt module (kbi) 239 15.6.3.3 port-f pull-up enable register the pulll-up enable register enables or disables the pull-up device for port f. pfpe7?fpe0 ?port f pull-up enable bits these read/write bits enable/disable the pull-up device. reset sets ddrf7?drf0 to ??, enabling all port f pull-up devices. 1 = corresponding port f pin pull-up device enabled 0 = corresponding port f pin pull-up device disabled 15.7 wait mode the keyboard modules remain active in wait mode. clearing the imaskx bit in the keyboard status and control register enables keyboard interrupt requests to bring the mcu out of wait mode. 15.8 stop mode the keyboard modules remain active in stop mode. clearing the imaskx bit in the keyboard status and control register enables keyboard interrupt requests to bring the mcu out of stop mode. 15.9 keyboard module during break interrupts the system integration module (sim) controls whether the keyboard interrupt latch cam be cleared during the break state. the bcfe bit in address: $0042 bit 7 654321 bit 0 read: pfpe7 pfpe6 pfpe5 pfpe4 pfpe3 pfpe2 pfpe1 pfpe0 write: reset: 11111111 figure 15-10. port f pull-up enable register (pfper)
keyboard interrupt module (kbi) advance information mc68hc(7)08kh12 ? rev. 1.0 240 keyboard interrupt module (kbi) motorola the break flag control register (bfcr) enables software to clear status bits during the break state. to allow software to clear the keyboard interrupt latch during a break interrupt, write a logic 1 to the bcfe bit. if a latch is cleared during the break state, it remains cleared when the mcu exits the break state. to protect the latch during the break state, write a logic 0 to the bcfe bit. with bcfe at logic 0 (its default state), writing to the keyboard acknowledge bit (ackx) in the keyboard status and control register during the break state has no effect.
mc68hc(7)08kh12 ? rev. 1.0 advance information motorola break module (break) 241 advance information ?mc68hc(7)08kh12 section 16. break module (break) 16.1 contents 16.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241 16.3 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242 16.4 functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242 16.4.1 flag protection during break interrupts . . . . . . . . . . . . . . 244 16.4.2 cpu during break interrupts. . . . . . . . . . . . . . . . . . . . . . . 244 16.4.3 tim during break interrupts . . . . . . . . . . . . . . . . . . . . . . . 244 16.4.4 cop during break interrupts . . . . . . . . . . . . . . . . . . . . . . 244 16.5 break module registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244 16.5.1 break status and control register (brkscr) . . . . . . . . . 245 16.5.2 break address registers (brkh and brkl) . . . . . . . . . . 245 16.6 low-power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246 16.6.1 wait mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246 16.6.2 stop mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246 16.2 introduction this section describes the break module. the break module can generate a break interrupt that stops normal program flow at a defined address to enter a background program.
break module (break) advance information mc68hc(7)08kh12 ? rev. 1.0 242 break module (break) motorola 16.3 features features of the break module include the following: accessible i/o registers during the break interrupt cpu-generated break interrupts software-generated break interrupts cop disabling during break interrupts 16.4 functional description when the internal address bus matches the value written in the break address registers, the break module issues a breakpoint signal (bkpt ) to the sim. the sim then causes the cpu to load the instruction register with a software interrupt instruction (swi) after completion of the current cpu instruction. the program counter vectors to $fffc and $fffd ($fefc and $fefd in monitor mode). the following events can cause a break interrupt to occur: a cpu-generated address (the address in the program counter) matches the contents of the break address registers. software writes a logic one to the brka bit in the break status and control register. when a cpu generated address matches the contents of the break address registers, the break interrupt begins after the cpu completes its current instruction. a return from interrupt instruction (rti) in the break routine ends the break interrupt and returns the mcu to normal operation. figure 16-1 shows the structure of the break module.
break module (break) functional description mc68hc(7)08kh12 ? rev. 1.0 advance information motorola break module (break) 243 figure 16-1. break module block diagram iab[15:8] iab[7:0] 8-bit comparator 8-bit comparator control break address register low break address register high iab[15:0] bkpt (to sim) table 16-1. break i/o register summary addr. register name bit 7 654321 bit 0 $fe0c break address register high (brkh) read: bit15 bit14 bit13 bit12 bit11 bit10 bit9 bit8 write: reset: 00000000 $fe0d break address register low (brkl) read: bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 write: reset: 00000000 $fe0e break status/control register (brkscr) read: brke brka 000000 write: reset: 00000000 = unimplemented
break module (break) advance information mc68hc(7)08kh12 ? rev. 1.0 244 break module (break) motorola 16.4.1 flag protection during break interrupts the system integration module (sim) controls whether or not module status bits can be cleared during the break state. the bcfe bit in the break flag control register (bfcr) enables software to clear status bits during the break state. (see 7.8.3 break flag control register (bfcr) and see the break interrupts subsection for each module.) 16.4.2 cpu during break interrupts the cpu starts a break interrupt by: loading the instruction register with the swi instruction loading the program counter with $fffc:$fffd ($fefc:$fefd in monitor mode) the break interrupt begins after completion of the cpu instruction in progress. if the break address register match occurs on the last cycle of a cpu instruction, the break interrupt begins immediately. 16.4.3 tim during break interrupts a break interrupt stops the timer counter. 16.4.4 cop during break interrupts the cop is disabled during a break interrupt when v dd + v hi is present on the rst pin. 16.5 break module registers three registers control and monitor operation of the break module: break status and control register (brkscr) break address register high (brkh) break address register low (brkl)
break module (break) break module registers mc68hc(7)08kh12 ? rev. 1.0 advance information motorola break module (break) 245 16.5.1 break status and control register (brkscr) the break status and control register contains break module enable and status bits. brke ?break enable bit this read/write bit enables breaks on break address register matches. clear brke by writing a logic zero to bit 7. reset clears the brke bit. 1 = breaks enabled on 16-bit address match 0 = breaks disabled brka ?break active bit this read/write status and control bit is set when a break address match occurs. writing a logic one to brka generates a break interrupt. clear brka by writing a logic zero to it before exiting the break routine. reset clears the brka bit. 1 = break address match 0 = no break address match 16.5.2 break address registers (brkh and brkl) the break address registers contain the high and low bytes of the desired breakpoint address. reset clears the break address registers. address: $fe0e bit 7 654321 bit 0 read: brke brka 000000 write: reset: 00000000 = unimplemented figure 16-2. break status and control register (brkscr)
break module (break) advance information mc68hc(7)08kh12 ? rev. 1.0 246 break module (break) motorola 16.6 low-power modes the wait and stop instructions put the mcu in low-power- consumption standby modes. 16.6.1 wait mode if enabled, the break module is active in wait mode. in the break routine, the user can subtract one from the return address on the stack if sbsw is set (see 7.7 low-power modes ). clear the sbsw bit by writing logic zero to it. 16.6.2 stop mode a break interrupt causes exit from stop mode and sets the sbsw bit in the break status register. see 7.8 sim registers . address: $fe0c bit 7 654321 bit 0 read: bit15 bit14 bit13 bit12 bit11 bit10 bit9 bit8 write: reset: 00000000 address: $fe0d bit 7 654321 bit 0 read: bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 write: reset: 00000000 figure 16-3. break address registers (brkh and brkl)
mc68hc(7)08kh12 ? rev. 1.0 advance information motorola preliminary electrical specifications 247 advance information ?mc68hc(7)08kh12 section 17. preliminary electrical specifications 17.1 contents 17.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247 17.3 absolute maximum ratings . . . . . . . . . . . . . . . . . . . . . . . . . . 248 17.4 functional operating range. . . . . . . . . . . . . . . . . . . . . . . . . . 249 17.5 thermal characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249 17.6 dc electrical characteristics . . . . . . . . . . . . . . . . . . . . . . . . . 250 17.7 control timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251 17.8 oscillator characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251 17.9 usb dc electrical characteristics . . . . . . . . . . . . . . . . . . . . . 252 17.10 usb low speed source electrical characteristics. . . . . . . . . 253 17.11 usb high speed source electrical characteristics . . . . . . . . 254 17.12 hub repeater electrical characteristics . . . . . . . . . . . . . . . 255 17.13 usb signaling levels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256 17.14 timer interface module characteristics . . . . . . . . . . . . . . . . . 256 17.15 clock generation module characteristics . . . . . . . . . . . . . . . 257 17.15.1 cgm component specifications . . . . . . . . . . . . . . . . . . . . 257 17.15.2 cgm electrical specifications . . . . . . . . . . . . . . . . . . . . . . 257 17.15.3 acquisition/lock time specifications . . . . . . . . . . . . . . . . 258 17.2 introduction this section contains electrical and timing specifications. these values are design targets and have not yet been fully tested.
preliminary electrical speci?ations advance information mc68hc(7)08kh12 ? rev. 1.0 248 preliminary electrical specifications motorola 17.3 absolute maximum ratings maximum ratings are the extreme limits to which the mcu can be exposed without permanently damaging it. note: this device is not guaranteed to operate properly at the maximum ratings. refer to 17.6 dc electrical characteristics for guaranteed operating conditions. note: this device contains circuitry to protect the inputs against damage due to high static voltages or electric fields; however, it is advised that normal precautions be taken to avoid application of any voltage higher than maximum-rated voltages to this high-impedance circuit. for proper operation, it is recommended that v in and v out be constrained to the range v ss (v in or v out ) v dd . reliability of operation is enhanced if unused inputs are connected to an appropriate logic voltage level (for example, either v ss or v dd .) characteristic (1) 1. voltages referenced to v ss . symbol value unit supply voltage v dd 0.3 to +6.0 v input voltage (except usb port pins) v in v ss 0.3 to v dd +0.3 v programming voltage v pp v ss 0.3 to 14.0 v usb port pins v usb ? to 4.6 v maximum current per pin excluding v dd and v ss i 25 ma storage temperature t stg 55 to +150 c maximum current out of v ss i mvss 100 ma maximum current into v dd i mvdd 100 ma
preliminary electrical specifications functional operating range mc68hc(7)08kh12 ? rev. 1.0 advance information motorola preliminary electrical specifications 249 17.4 functional operating range 17.5 thermal characteristics characteristic symbol value unit operating temperature range t a 0 to 85 c operating voltage range v dd 4.0 to 5.5 v characteristic symbol value unit thermal resistance qfp (64 pins) q ja 70 c/w i/o pin power dissipation p i/o user determined w power dissipation (1) p d p d = (i dd x v dd ) + p i/o = k/(t j + 273 c) w constant (2) k p d x (t a + 273 c ) + p d 2 q ja w/ c average junction temperature t j t a + (p d q ja ) c maximum junction temperature t jm 100 c notes 1. power dissipation is a function of temperature. 2. k is a constant unique to the device. k can be determined for a known t a and measured p d. with this value of k, p d and t j can be determined for any value of t a .
preliminary electrical speci?ations advance information mc68hc(7)08kh12 ? rev. 1.0 250 preliminary electrical specifications motorola 17.6 dc electrical characteristics characteristic symbol min typ (2) max unit output high voltage (i load = 2.0ma) all i/o pins v oh v dd ?0.8 v output low voltage (i load = 1.6ma) all i/o pins v ol 0.4 v input high voltage all ports, irq1 /v pp , rst , osc1 v ih 0.7 v dd ? dd v input low voltage all ports, irq1 /v pp , rst , osc1 v il v ss 0.3 v dd v output high current (v oh = 2.1v) port c in ldd mode i oh 3 4.5 6 ma output low current (v ol = 2.3v) port c in ldd mode i ol 10 15 20 ma v dd supply current run, usb active, pll on, f op = 6.0mhz (3) run, usb suspended, pll off, f op = 1.5mhz (3) wait (4) stop (5) 0 c to 85 c i dd 20 3 1 350 ma ma ma m a i/o ports hi-z leakage current i il 10 m a input current i in 1 m a capacitance ports (as input or output) c out c in 12 8 pf por rearm voltage (6) v por 0 100 mv por rise time ramp rate (7) r por 0.035 v/ms monitor mode entry voltage v dd +v hi 1.4 v dd 2.0 v dd v pullup resistor pa0-pa7, pb0-pb7, pc0-pc7, pd0-pd7, pe0- pe3, pf0-pf7, rst , irq1 /v pp r pu 20 35 50 k w schmitt trigger input high level pd0-pd7, pe0-pe3, pf0-pf7 v shi 2.8 3.4 v schmitt trigger input low level pd0-pd7, pe0-pe3, pf0-pf7 v shl 1.7 2.3 v notes: 1. v dd = 4.0 to 5.5 vdc, v ss = 0 vdc, t a = t l to t h , unless otherwise noted. 2. typical values reflect average measurements at midpoint of voltage range, 25 c only. 3. run (operating) i dd measured using external square wave clock source. all inputs 0.2 v from rail. no dc loads. less than 100 pf on all outputs. c l = 20 pf on osc2. all ports configured as inputs. osc2 capacitance linearly affects run i dd . measured with all modules enabled. 4. wait i dd measured using external square wave clock source (f cgmxclk = 6 mhz); all inputs 0.2 v from rail; no dc loads; less than 100 pf on all outputs. c l = 20 pf on osc2; usb in suspend mode, 15 k w 5% termination resistors on d+ and d pins; all ports con- figured as inputs; osc2 capacitance linearly affects wait i dd . 5. stop i dd measured with usb in suspend mode, osc1 grounded, 1.425 k w 1% pull-up resistor on d+ pin and 15 k w 1% pull- down resistors on d+ and d?pins, no port pins sourcing current. 6. maximum is highest voltage that por is guaranteed. 7. if minimum v dd is not reached before the internal por reset is released, rst must be driven low externally until minimum v dd is reached. 8. r pu is measured at v dd = 5.0v.
preliminary electrical specifications control timing mc68hc(7)08kh12 ? rev. 1.0 advance information motorola preliminary electrical specifications 251 17.7 control timing 17.8 oscillator characteristics characteristic symbol min max unit internal operating frequency (2) f op 6 mhz rst input pulse width low (3) t irl 50 ns notes: 1. v dd = 4.0 to 5.5 vdc, v ss = 0 vdc; timing shown with respect to 20% v dd and 70% v dd , unless otherwise noted. 2. some modules may require a minimum frequency greater than dc for proper operation; see appropriate table for this information. 3. minimum pulse width reset is guaranteed to be recognized. it is possible for a smaller pulse width to cause a reset. characteristic symbol min typ max unit crystal frequency (1) f cgmxclk 6 mhz external clock reference frequency (1), (2) f cgmxclk dc 24 mhz crystal load capacitance (3) c l crystal fixed capacitance (3) c 1 ? c l crystal tuning capacitance (3) c 2 ? c l feedback bias resistor r b ?0 m w series resistor (3), (4) r s notes: 1. the usb module is designed to function at f cgmxclk = 6mhz and cgmvclk = 48mhz. the values given here are oscillator specifications. 2. no more than 10% duty cycle deviation from 50% 3. consult crystal vendor data sheet 4. not required for high frequency crystals
preliminary electrical speci?ations advance information mc68hc(7)08kh12 ? rev. 1.0 252 preliminary electrical specifications motorola 17.9 usb dc electrical characteristics characteristic symbol conditions min typ max unit hi-z state data line leakage i lo 0v preliminary electrical specifications usb low speed source electrical characteristics mc68hc(7)08kh12 ? rev. 1.0 advance information motorola preliminary electrical specifications 253 17.10 usb low speed source electrical characteristics characteristic symbol conditions (notes 1,2,3) min typ max unit transition time: rise time fall time t r t f notes 4, 5, 8 c l = 200pf c l = 600pf c l =200pf c l = 600pf 75 75 300 300 ns rise/fall time matching t rfm t r /t f 80 120 % output signal crossover voltage v crs 1.3 2.0 v low speed data rate t drate 1.5mbs 1.5% 1.4775 676.8 1.500 666.0 1.5225 656.8 mbs ns source differential driver jitter to next transition for paired transitions t udj1 t udj2 c l =350pf notes 6, 7 ?5 ?0 25 10 ns ns receiver data jitter tolerance to next transition for paired transitions t djr1 t djr2 c l =350pf note 7 ?5 ?5 75 45 ns ns source eop width teopt note 7 1.25 1.50 m s differential to eop transition skew tdeop note 7 40 100 ns receiver eop width must reject as eop must accept t eopr1 t eopr2 note 7 330 670 ns ns notes: 1. all voltages measured from local ground, unless otherwise specified. 2. all timings use a capacitive load of 50pf, unless otherwise specified. 3. low speed timings have a 1.5k w pull-up to 2.8v on the d?data line. 4. measured from 10% to 90% of the data signal. 5. the rising and falling edges should be smoothly transitioning (monotonic). 6. timing differences between the differential data signals. 7. measured at crossover point of differential data signals. 8. capacitive loading includes 50pf of tester capacitance.
preliminary electrical speci?ations advance information mc68hc(7)08kh12 ? rev. 1.0 254 preliminary electrical specifications motorola 17.11 usb high speed source electrical characteristics characteristic symbol conditions (notes 1,2,3) min typ max unit transition time: rise time fall time t r t f notes 4,5,8 c l =50pf c l =50pf 4 4 20 20 ns ns rise/fall time matching t rfm t r /t f 90 110 % output signal crossover voltage v crs 1.3 2.0 v high speed data rate t drate 12mbs 0.25% 11.97 12.03 mbs ns frame interval t frame 1.0ms 0.05% 0.9995 1.0005 ms source differential driver jitter to next transition for paired transitions t dj1 t dj1 c l =50pf notes 6, 7 3.5 4.0 3.5 4.0 ns ns source eop width teopt note 7 160 175 ns differential to eop transition skew tdeop note 7 2 5 ns receive data jitter tolerance to next transition for paired transitions t jr1 t jr2 c l =50pf notes 6, 7 18.5 ? 18.5 9 ns ns receiver eop width must reject as eop must accept t eopr1 t eopr2 note 7 40 82 ns ns notes: 1. all voltages measured from local ground, unless otherwise specified. 2. all timings use a capacitive load of 50pf, unless otherwise specified. 3. high speed timings have a 1.5k w pull-up to 2.8v on the d+ data line. 4. measured from 10% to 90% of the data signal. 5. the rising and falling edges should be smoothly transitioning (monotonic). 6. timing differences between the differential data signals. 7. measured at crossover point of differential data signals. 8. capacitive loading includes 50pf of tester capacitance.
preliminary electrical specifications hub repeater electrical characteristics mc68hc(7)08kh12 ? rev. 1.0 advance information motorola preliminary electrical specifications 255 17.12 hub repeater electrical characteristics low speed hub electrical characteristics (root port and downstream ports con?ured as low speed) characteristic symbol conditions (notes 1,2,3) min typ max unit hub differential data delay tlhdd note 4, 7, 8 300 ns hub differential driver jitter (including cable) downstream: to next transition for paired transitions upstream to next transition for paired transitions t ldhj1 t ldhj2 t luhj1 t luhj2 note 4, 7, 8 ?5 ?5 45 45 45 15 45 45 ns ns ns ns data bit width distortion after eop. tsop note 4,8 60 60 ns hub eop delay relative to t hdd tleopd note 4,8 0 200 ns hub eop output width skew tlhesk note 4,8 300 300 ns full speed hub electrical characteristics (root port and downstream ports con?ured as full speed) characteristic symbol conditions (notes 1,2,3) min typ max unit hub differential data delay (with cable) (without cable) t hdd1 t hdd1 note 3, 7, 8 70 40 ns ns hub differential driver jitter (including cable) to next transition for paired transitions t hdj1 t hdj2 note 3, 7, 8 ? ? 3 1 ns ns data bit width distortion after sop. t sop note 3, 8 5 5 ns hub eop delay relative to t hdd t eopd note 3, 8 0 15 ns hub eop output width skew t hesk note 3, 8 15 15 ns notes: 1. all voltages measured from local ground, unless otherwise specified. 2. all timings use a capacitive load of (cl) to ground of 50pf, unless otherwise specified. 3. full speed timings have a 1.5k w pull-up to 2.8v on the d+ data line. 4. low speed timings have a 1.5k w pull-up to 2.8v on the d?data line. 5. measured from 10% to 90% of the data signal. 6. the rising and falling edges should be smoothly transitioning (monotonic). 7. timing differences between the differential data signals. 8. measured at crossover point of differential data signals. 9. the maximum load specification is the maximum effective capacitive load allowed that meets the target hub vbus droop of 330m v.
preliminary electrical speci?ations advance information mc68hc(7)08kh12 ? rev. 1.0 256 preliminary electrical specifications motorola 17.13 usb signaling levels 17.14 timer interface module characteristics bus state signaling levels transmit receive differential 1 d+ > v oh (min) and d?< v ol (max) (d+) ?(d? > 200 mv differential 0 d?> v oh (min) and d?< v ol (max) (d? ?(d+) > 200 mv single-ended 0 (se0) d+ and d?< v ol (max) d+ and d?< v il (max) ( data j state low speed full speed differential 0 differential 1 differential 0 differential 1 data k state low speed full speed differential 1 differential 0 differential 1 differential 0 idle state low speed full speed na d?> v ihz (min) and d+ < v il (max) d+ > v ihz (min) and d?< v il (max) resume state data k state data k state start of packet (sop) data lines switch from idle to k state end of packet (eop) se0 for approximately 2 bit times (1) followed by a j for 1 bit time 1. the width of eop is defined in bit times relative to the speed of transmission. se0 for 3 1 bit times (2) followed by a j 2. the width of eop is defined in bit times relative to the device type receiving the eop. the bit time is approximate. reset d+ and d?< v ol (max) for 3 10 ms d+ and d?< v il (max) for 3 2.5 m s characteristic symbol min max unit input capture pulse width t tih, t til 125 ns input clock pulse width t tch, t tcl (1/f op ) + 5 ns
preliminary electrical specifications clock generation module characteristics mc68hc(7)08kh12 ? rev. 1.0 advance information motorola preliminary electrical specifications 257 17.15 clock generation module characteristics 17.15.1 cgm component specifications 17.15.2 cgm electrical specifications characteristic symbol min typ max unit crystal reference frequency (1) 1. fundamental mode crystals only f xclk 6 mhz crystal load capacitance (2) 2. consult crystal manufacturer? data. c l pf crystal fixed capacitance (2) c 1 20 pf crystal tuning capacitance (2) c 2 20 pf feedback bias resistor r b 10 m w series resistor r s 0k w notes: description symbol min typ max unit operating voltage v dd 4.0 5.5 v operating temperature t 0 25 70 o c crystal reference frequency f rclk 6 mhz vco center-of-range frequency f vrs 48 mhz vco multiply factor n 1 4095 vco prescale multiplier 2 p 118 reference divider factor r 1 1 15 vco operating frequency f vclk 40 56 mhz
preliminary electrical speci?ations advance information mc68hc(7)08kh12 ? rev. 1.0 258 preliminary electrical specifications motorola 17.15.3 acquisition/lock time specifications description symbol min typ max notes filter capacitor multiply factor c fact 0.0145 f/s v acquisition mode time factor k acq 0.117 v tracking mode time factor k trk 0.021 v manual mode time to stable t acq if c f chosen correctly manual stable to lock time t al if c f chosen correctly manual acquisition time t lock ? acq + t al tracking mode entry frequency tolerance d trk 0 3.6% acquisition mode entry frequency tolerance d acq 6.3% 7.2% lock entry frequency tolerance d lock 0 0.9% lock exit frequency tolerance d unl 0.9% 1.8% reference cycles per acquisition mode measurement n acq 32 reference cycles per tracking mode measurement n trk 128 automatic mode time to stable t acq n acq /f rdv if c f chosen correctly automatic stable to lock time t al n trk /f rdv if c f chosen correctly automatic lock time t lock ? acq + t al 8v dda f rdv k acq ----------------------------- - 4v dda f rdv k trx ----------------------------- 8v dda f rdv k acq ----------------------------- - 4v dda f rdv k trx -----------------------------
mc68hc(7)08kh12 ? rev. 1.0 advance information motorola mechanical specifications 259 advance information ?mc68hc(7)08kh12 section 18. mechanical specifications 18.1 contents 18.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259 18.3 plastic quad flat pack (qfp). . . . . . . . . . . . . . . . . . . . . . . . . 260 18.2 introduction this section gives the dimensions for: 64-pin plastic quad flat pack (case 840c-04) the following figures show the latest package drawings at the time of this publication. to make sure that you have the latest package specifications, contact one of the following: local motorola sales office motorola mfax phone 602-244-6609 email rmfax0@email.sps.mot.com worldwide web (wwweb) at http://motorola.com/sps follow mfax or worldwide web on-line instructions to retrieve the current mechanical specifications.
mechanical speci?ations advance information mc68hc(7)08kh12 ? rev. 1.0 260 mechanical specifications motorola 18.3 plastic quad flat pack (qfp) figure 18-1. 64-pin quad-flat-pack (case 840c-04) g h e c detail a l a 48 s l ? ? ? 0.05 (0.002) a? s a? m 0.20 (0.008) d s h s a? m 0.20 (0.008) d s c b v 0.05 (0.002) d s a? m 0.20 (0.008) d s h s a? m 0.20 (0.008) d s c seating plane datum plane ? ? 49 33 32 64 17 1 16 detail c 0.10 (0.004) s a? m 0.20 (0.008) d s c section b? f n d base j metal detail a p bb ?? ?? ? notes: 1. dimensioning and tolerancing per ansi y14.5m, 1982. 2. controlling dimension: millimeter. 3. datum plane ??is located at bottom of lead and is coincident with the lead where the lead exits the plastic body at the bottom of the parting line. 4. datums a? and ??to be determined at datum plane ?? 5. dimensions s and v to be determined at seating plane ?? 6. dimensions a and b do not include mold protrusion. allowable protrusion is 0.25 (0.010) per side. dimensions a and b do include mold mismatch and are determined at datum plane ?? 7. dimension d does not include dambar protrusion. dambar protrusion shall not cause the d dimension to exceed 0.53 (0.021). dambar cannot be located on the lower radius or the foot. 8. dimension k is to be measured from the theoretical intersection of lead foot and leg centerlines. dim min max min max inches millimeters a 13.90 14.10 0.547 0.555 b 13.90 14.10 0.547 0.555 c 2.07 2.46 0.081 0.097 d 0.30 0.45 0.012 0.018 e 2.00 0.079 f 0.30 0.012 g 0.80 bsc 0.031 bsc h 0.067 0.250 0.003 0.010 j 0.130 0.230 0.005 0.090 k l 12.00 ref 0.472 ref m n 0.130 0.170 0.005 0.007 p 0.40 bsc 0.016 bsc q r 0.13 0.30 0.005 0.012 s 16.20 16.60 0.638 0.654 t 0.20 ref 0.008 ref u v 16.20 16.60 0.638 0.654 x 1.10 1.30 0.043 0.051 2.40 0.094 detail c seating plane m u t r q k x m 5 5 10 10 2 2 8 8 0 0 0.660 0.020 0.026 0.500

motorola reserves the right to make changes without further notice to any products herein. motorola makes no warranty, represe ntation or guarantee regarding the suitability of its products for any particular purpose, nor does motorola assume any liability arising out of the application o r use of any product or circuit, and speci?ally disclaims any and all liability, including without limitation consequential or incidental damages. "typical" parameters which may be provided in motorola data sheets and/or speci?ations can and do vary in different applications and actual performance may vary over time. all operating parameters, i ncluding "typicals" must be validated for each customer application by customer's technical experts. motorola does not convey any license under its patent rights nor th e rights of others. motorola products are not designed, intended, or authorized for use as components in systems intended for surgical implant into the body, or other applic ations intended to support or sustain life, or for any other application in which the failure of the motorola product could create a situation where personal injury or death may occur. should buyer purchase or use motorola products for any such unintended or unauthorized application, buyer shall indemnify and hold motorola and its of?ers, employees, subsidiaries, af?iates, and distributors harmless against all claims, costs, damages, and expenses, and reasonable attorney fees arising out of, directly o r indirectly, any claim of personal injury or death associated with such unintended or unauthorized use, even if such claim alleges that motorola was negligent regarding the design or manufacture of the part. motorola and are registered trademarks of motorola, inc. motorola, inc. is an equal opportunity/af?mative action employer.


▲Up To Search▲   

 
Price & Availability of MC68HC08KH12

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X